i 绝望

依然

Miss Lang
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 31 下一页
  2013年11月10日
摘要: 总结:BufferedInputStream();package com.aini;import java.io.*;//使用BufferedInputStream读取文件public class yhtrds { //这是一个方法 public static byte[] readFileByBufferedInputStream(File file){ BufferedInputStream bis; FileInputStream fis; ByteArrayOutputStream ot=new ByteArrayOutputStream();//字节数组输出流 try{/... 阅读全文
posted @ 2013-11-10 20:54 juewang 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 总结:输入流/输出流方法,变量;package com.aini;//流类。输入输出流import java.io.*;public class rtyeew {// (File file)这里是方法传递参数的意思吗。 public static void copyFileByFileOutputStream(File file) throws IOException { FileInputStream fis = null;// 复制 FileOutputStream fos = null;// 由于后面要关闭文件,所以这里要声明是null byte[] b = new byte[20... 阅读全文
posted @ 2013-11-10 20:18 juewang 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 总结:package com.aini;import java.io.*;public class tre { public static void main(String[] args) { int b; try { System.out.println("Please input:"); while ((b = System.in.read()) != -1) { System.out.print((char) b); } } catch (IOException e) { System.out.println(e.toString()); } }}//Ple... 阅读全文
posted @ 2013-11-10 12:12 juewang 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 总结:package com.aini;import java.io.IOException;import java.io.InputStreamReader;//流类 import java.io.DataInputStream;import java.io.DataOutputStream;import java.io.FileNotFoundException;import java.io.OutputStreamWriter;import java.io.FileOutputStream;import java.io.OutputStreamWriter;import java.io. 阅读全文
posted @ 2013-11-10 10:56 juewang 阅读(251) 评论(0) 推荐(0) 编辑
  2013年11月9日
摘要: 总结:空格???懂否?如何显示for(int i=0;i<100;i++){if(i%10==0){System.out.println();}System.out.print(n[i]);//这种空格控制类型。类似打印星星。金字塔形,直角,等腰。好好琢磨}package com.da;//输出10个一行的随机数 //100个数10个一行的输出import java.util.Random;public class hk { public static void main(String[] args) {// 这里输出随机数 int n[] = new int[100];// 定义一个1 阅读全文
posted @ 2013-11-09 23:51 juewang 阅读(1095) 评论(0) 推荐(0) 编辑
摘要: 总结:对于各种流类,package com.da;//包括运行异常,和非运行异常import java.io.*;public class ryl { public static void main(String[] args) { try { FileInputStream fis = new FileInputStream("log.txt"); int s; while ((s = fis.read()) != -1) { System.out.println(s); } fis.close(); } catch (FileNotFoundException... 阅读全文
posted @ 2013-11-09 22:12 juewang 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 总结:注意一个方法:nextLine();它表示:执行当前行,返回跳过的输入信息。package com.da;import java.util.InputMismatchException;import java.util.Scanner;//从键盘输入数,判断,是double型则输出。通过循环变量退出do-while循环//若不是,则系统提示异常,该异常被catch语句捕获。catch语句用来显示数据输入错误提示信息。//并提示用户重新输入,然后通过循环变量使do-while循环继续执行。 要求用户重新输入//其中 Scanner中的方法 String nextline()的作用是:... 阅读全文
posted @ 2013-11-09 21:52 juewang 阅读(1186) 评论(0) 推荐(0) 编辑
摘要: 总结:掌握流。缓冲区类的方法package com.b;import java.io.BufferedReader;import java.io.File;import java.io.FileReader;public class Mark { public static void main(String[] args) throws Exception { Stream st = new Stream("log.txt"); }}class Stream { public Stream(String pathName) throws Exception { Buffer 阅读全文
posted @ 2013-11-09 10:06 juewang 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 总结:运用throw和throws抛出异常,在哪一种情况下该怎么抛出异常。重要package com.b;//异常中throwe和throws的用法public class yz { public static void main(String[] args) { System.out.println("新浪微博-----"); try{ System.out.println(1/0); }catch(ArithmeticException e){ System.out.println("除数不为0"); } System.out.println(&qu 阅读全文
posted @ 2013-11-09 09:46 juewang 阅读(187) 评论(0) 推荐(0) 编辑
  2013年11月8日
摘要: 总结:正则表达式--package com.c2;//写一个spli的用法,数字类 ===分割字符串 public class yqw { public static void main(String[] args) { String a = "192.168.43.130"; String c[] = a.split("\\.");// 数组 for (int i = 0; i < c.length; i++) { System.out.println(c[i]); } }}//19216843130 阅读全文
posted @ 2013-11-08 14:14 juewang 阅读(3157) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 31 下一页

绝望依然

Miss Lang