i 绝望

依然

Miss Lang
  2013年11月13日
摘要: 总结:抛出异常package com.ds;//异常捕获public class fdsg { private static void throwException() { try { String a = null; if (a == null) { throw new NullPointerException("s is null"); } } catch (NullPointerException e) { System.out.println("方法throwException()中抛出一个NullException异常,"); throw e; 阅读全文
posted @ 2013-11-13 22:57 juewang 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 总结:BufferedReader。InputStreamReader.字节与字符的区别。package com.ds;import java.io.*;//从控制台输入字符串,输到sdd时停止输入public class yuiy { public static void main(String[] args) throws Exception { BufferedReader b = new BufferedReader(new InputStreamReader(System.in)); String s;// 字符串、结果:输入字符串 System.out.println(" 阅读全文
posted @ 2013-11-13 20:19 juewang 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 总结:read()方法返回类型是int型??不知道该怎么用好循环》package com.da;import java.io.*;public class fgbv { public static void main(String[] args) throws IOException { BufferedReader bb = new BufferedReader(new InputStreamReader(System.in)); char c; System.out.println("enter a line"); do { c = (char) bb.read(); 阅读全文
posted @ 2013-11-13 07:52 juewang 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 总结:输入流、输出流。。子类多。需要加强:package com.da;import java.io.*;public class rtr { public static void main(String[] args) { File file=new File("dfad.txt"); OutputStream ops=null; try{ ops=new FileOutputStream(file,true);//是否追加 String a="fasdf is my "; byte []b=new byte[1325]; for(byte temp: 阅读全文
posted @ 2013-11-13 00:35 juewang 阅读(315) 评论(0) 推荐(0) 编辑

绝望依然

Miss Lang