上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页
摘要: importjava.util.concurrent.ExecutorService;importjava.util.concurrent.Executors;importjava.util.concurrent.Future;importjava.util.concurrent.locks.Lock;importjava.util.concurrent.locks.ReadWriteLock;importjava.util.concurrent.locks.ReentrantLock;importjava.util.concurrent.locks.ReentrantReadWriteLoc 阅读全文
posted @ 2011-12-17 23:32 远哥 阅读(1274) 评论(0) 推荐(0) 编辑
摘要: importjava.util.concurrent.Callable;importjava.util.concurrent.ExecutionException;importjava.util.concurrent.ExecutorService;importjava.util.concurrent.Executors;importjava.util.concurrent.Future;importjava.util.concurrent.ScheduledExecutorService;importjava.util.concurrent.TimeUnit;/**在J2SE之前启动一个任务 阅读全文
posted @ 2011-12-17 23:31 远哥 阅读(957) 评论(0) 推荐(0) 编辑
摘要: importjava.util.concurrent.Callable;importjava.util.concurrent.ExecutorService;importjava.util.concurrent.Executors;importjava.util.concurrent.Future;/**从本节开始,主要介绍J2SE5.0与线程相关的新特性,新的线程类主要集中在java.util.concurrent包中,本节实例将介绍如何使用java.util.concurrent.Callable和java.util.concurrent.Future类,用Callable定义一个任务并启 阅读全文
posted @ 2011-12-17 23:30 远哥 阅读(1436) 评论(0) 推荐(0) 编辑
摘要: importjava.lang.management.ClassLoadingMXBean;importjava.lang.management.CompilationMXBean;importjava.lang.management.GarbageCollectorMXBean;importjava.lang.management.ManagementFactory;importjava.lang.management.MemoryMXBean;importjava.lang.management.OperatingSystemMXBean;importjava.lang.managemen 阅读全文
posted @ 2011-12-17 23:29 远哥 阅读(1009) 评论(0) 推荐(0) 编辑
摘要: importjava.lang.annotation.ElementType;importjava.lang.annotation.Target;importjava.lang.annotation.Retention;importjava.lang.annotation.RetentionPolicy;/**关键技术*1.Java常用的内置注释*@Override放在方法的修饰符前,表示该方法覆盖了父类的同名同参数方法,如果该方法没有覆盖父 类的方法而使用了该注释,则编译器会报错*@Deprecated放在变量和方法的访问修饰符前,表示该变量或者方法已经不推荐使用,通常是因为它很危险或者存在 阅读全文
posted @ 2011-12-17 23:29 远哥 阅读(725) 评论(0) 推荐(0) 编辑
摘要: importjava.util.ArrayList;importjava.util.Collection;importjava.util.List;/***泛型编程关键掌握两点:*1.在方法参数中使用通配符*2.在方法的参数类型和返回类型中使用通用类型*//**关键技术*1.通配符问号(?)表示任意类型.如"List<?>"表示可以存放任意对象类型的List*2.通配符可以接extends和super,表示有限制的通配符.如"List<? extends Parent>"*声明的List能且仅能存放Parent及其子类的对象,而& 阅读全文
posted @ 2011-12-17 23:28 远哥 阅读(584) 评论(0) 推荐(0) 编辑
摘要: importjava.io.BufferedReader;importjava.io.BufferedWriter;importjava.io.File;importjava.io.IOException;importjava.io.InputStream;importjava.io.InputStreamReader;importjava.io.OutputStreamWriter;importjava.util.ArrayList;importjava.util.Arrays;importjava.util.Iterator;importjava.util.List;importjava. 阅读全文
posted @ 2011-12-17 23:26 远哥 阅读(13814) 评论(4) 推荐(2) 编辑
摘要: importjava.util.Date;/***使用printf输出*//**关键技术点*使用java.io.PrintStream的printf方法实现C风格的输出*printf方法的第一个参数为输出的格式,第二个参数是可变长的,表示待输出的数据对象*/publicclassPrintf {publicstaticvoidmain(String[] args) {/***输出字符串***/// %s表示输出字符串,也就是将后面的字符串替换模式中的%sSystem.out.printf("%s",newInteger(1212));// %n表示换行System.out. 阅读全文
posted @ 2011-12-17 23:25 远哥 阅读(583) 评论(0) 推荐(0) 编辑
摘要: /***静态导入:是指可以import类的静态方法和静态变量,在使用时,无须指定类名,*便可以使用这些被import的静态方法和静态变量,这就是静态导入*写import语句时,可以定位到一个静态方法或静态变量(以前是定位到类)*可以使用通配符(*)代表导入该类的所有静态方法和静态变量*不允许静态方法和静态变量出现重名的情况*/importstaticjava.lang.Math.max;//导入了Math的max方法importstaticjava.lang.Math.min;//导入了Math的min方法importstaticjava.lang.Integer.*;//导入了Integer 阅读全文
posted @ 2011-12-17 23:24 远哥 阅读(362) 评论(0) 推荐(0) 编辑
摘要: /***在J2SE5.0之前,当传入到方法的参数个数不固定时,经常采用数组的方式传递参数*在J2SE5.0之后,可以使用可变长参数的我给方法传递参数*//***在参数类型和参数名之间使用"..."(三个英文的点),表示该参数为可变长的*通过新的for循环读取可变长参数中的值*一个方法里最多只能有一个变长参数,而且这个变长参数一定要放在参数表的最后一个参数*/importstaticjava.lang.System.*;publicclassVarArgs {publicstaticvoidprint(Integer... s){for(ints2:s){//解封out.pr 阅读全文
posted @ 2011-12-17 23:24 远哥 阅读(645) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页