上一页 1 ··· 4 5 6 7 8
摘要: 1.数组反转 1 import java.util.Arrays; 2 3 public class ArrayReverse { 4 public static void main(String[] args){ 5 int[] arr ={1,2,3,4,5,6,7,8,9}; 6 reverse(arr); 7 } 8 public static void reverse(int[] arr){ 9 for(int i=0;i<arr.length/2;i++){10 int temp = ... 阅读全文
posted @ 2012-06-26 23:23 Carve_Time 阅读(150) 评论(0) 推荐(0) 编辑
摘要: ☆ 1 public class equalsDemo { 2 public static void main(String[] args){ 3 4 /*使用==来判断两个变量是否相等时,如果两个变量时基本数据类型的 5 变量时,且都是数值类型是,则只要两个变量的值相等,使用==判断就返回true*/ 6 7 int i=65; 8 float f=65.0f; 9 System.out.println(i==f);//true10 char c='... 阅读全文
posted @ 2012-06-26 23:21 Carve_Time 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1 import java.io.IOException; 2 import java.io.PipedInputStream; 3 import java.io.PipedOutputStream; 4 5 public class PipedInputStreamDemo { 6 public static void main(String[] args) throws IOException{ 7 PipedInputStream pis =new PipedInputStream(); 8 PipedOutputStream pos =ne... 阅读全文
posted @ 2012-06-22 13:28 Carve_Time 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 1 import java.io.FileInputStream; 2 import java.io.FileNotFoundException; 3 import java.io.FileOutputStream; 4 import java.io.IOException; 5 import java.io.ObjectInputStream; 6 import java.io.ObjectOutputStream; 7 8 import reflect.Student; 9 10 public class ObjectInputStreamDemo {11 public sta... 阅读全文
posted @ 2012-06-22 11:35 Carve_Time 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 1 import java.io.IOException; 2 import java.io.SequenceInputStream; 3 import java.util.Enumeration; 4 import java.util.Vector; 5 6 public class SequenceInputStreamDemo { 7 public static void main(String[] args) throws IOException{ 8 Vector<FileInputStream> v = new Vector<FileInputStrea... 阅读全文
posted @ 2012-06-22 11:13 Carve_Time 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 字节打印流PrintStream字符打印流PrintWriter 阅读全文
posted @ 2012-06-22 10:50 Carve_Time 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 单一类:(静态成员变量&静态初始化块)<(成员变量&初始化块)<构造函数public class 对象初始化顺序 { public static void main(String[] args){ Person p = new Person(); }}class Person{ public static String staticfield ="静态成员变量"; public String field ="成员变量"; static { System.out.println(staticfield); System... 阅读全文
posted @ 2012-06-21 17:37 Carve_Time 阅读(141) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8