上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页
摘要: 当使用Serializable接口实现序列化操作时,如果一个对象中的某个属性不希望被序列化, 则可以使用transient关键字进行声明: import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; imp... 阅读全文
posted @ 2014-08-21 16:39 塔斯曼 阅读(110) 评论(0) 推荐(0) 编辑
摘要: import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; public class CharSetDemo02 { public static void main(String[] args) throws Exception { File fi... 阅读全文
posted @ 2014-08-21 15:50 塔斯曼 阅读(153) 评论(0) 推荐(0) 编辑
摘要: import java.io.IOException; import java.io.OutputStream; public class SystemDemo01 { public static void main(String[] args) { OutputStream out = System.out; //向上转型后丢失子类方法? ... 阅读全文
posted @ 2014-08-19 14:01 塔斯曼 阅读(188) 评论(0) 推荐(0) 编辑
摘要: import java.io.IOException; import java.io.PipedInputStream; import java.io.PipedOutputStream; class Send implements Runnable { private PipedOutputStream pos = null; public Send() { ... 阅读全文
posted @ 2014-08-19 13:59 塔斯曼 阅读(114) 评论(0) 推荐(0) 编辑
摘要: import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; imp... 阅读全文
posted @ 2014-08-19 10:08 塔斯曼 阅读(462) 评论(0) 推荐(0) 编辑
摘要: 字节流例子: import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; public class OutputStreamDemo05 { public static void main(Str... 阅读全文
posted @ 2014-08-19 09:29 塔斯曼 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 整个java.io包中最重要的就是5个类和一个接口,5个类指的是File,OutputStream,InputStream,Reader,Writer;一个接口是Serializable。 在整个io包中,唯一与文件本身有关的类就是file类。 import java.io.File; import java.io.FileInputStream; import java.io... 阅读全文
posted @ 2014-08-18 17:44 塔斯曼 阅读(123) 评论(0) 推荐(0) 编辑
摘要: import java.text.SimpleDateFormat; import java.util.Date; import java.util.Timer; import java.util.TimerTask; class MyTask extends TimerTask { public void run() { SimpleDateFor... 阅读全文
posted @ 2014-08-14 17:23 塔斯曼 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 不使用正则表达式: import java.util.Scanner; public class RagexDemo01 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String str = scanner.nex... 阅读全文
posted @ 2014-08-14 16:40 塔斯曼 阅读(134) 评论(0) 推荐(0) 编辑
摘要: import java.util.Observable; import java.util.Observer; class House extends Observable { private float price; public float getPrice() { return price; } public void ... 阅读全文
posted @ 2014-08-14 15:36 塔斯曼 阅读(119) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页