
android之java基础
holydancer
https://ddcode.net
展开
-
简单的IO流---文档内容转移
将”e:/from.txt”里的内容读取到”e:/to.txt” ------------------------------- import java.io.*; class Test { public static void main(String args[]) { FileInputStream fis = null; FileOutputStream fos = n原创 2012-02-27 08:56:53 · 915 阅读 · 0 评论 -
大文件的IO流—长篇文档复制
将”e:/str/from.txt”里的内容读取到”e:/str/to.txt” import java.io.*; class Test { public static void main(String args[]) { FileInputStream fis = null; FileOutputStream fos = null; try { fis = new F原创 2012-02-27 09:02:07 · 1438 阅读 · 2 评论 -
简单的多线程--双线程循环打印
概述: 类中主方法中一个循环打印,再start线程类的对象,二者争夺处理器. 下面是主方法类 public class Test { public static void main(String[] args) { Firstthread ft = new Firstthread(); ft.start(); for(int i=0;i<100;i++){ Syst原创 2012-02-27 09:09:39 · 1489 阅读 · 1 评论 -
实现线程的第二种方法
线程类实现Runnable 接口,其余无异,类中新建Thread对象,并以对象作为参数,然后利用Thread对象调用start()方法. public class Test { public static void main(String[] args) { Firstthread ft = new Firstthread(); Thread t = new Thread(ft);原创 2012-02-27 09:11:57 · 941 阅读 · 0 评论