摘要:
primitive types不需要用new,而且是传值而非引用。 int a = 0; long b = 0L; float c = 0f; double d = 0d; 阅读全文
posted @ 2009-12-23 16:37
Fan Zhang
阅读(145)
评论(0)
推荐(0)
摘要:
Your new class can be made up of any number and type of other objects, in any combination that you need to achieve the functionality desired in your new class. Because you are composing a new class fr... 阅读全文
posted @ 2009-12-23 14:28
Fan Zhang
阅读(370)
评论(0)
推荐(0)
摘要:
尽量采用List和HashMap,rather than Vector&Hashtable. Vector是有信号量的,可以同步锁,ArrayList没有,所以相对来说ArrayList的存取速度比Vector快。 同理HashMap比Hashtable快 阅读全文
posted @ 2009-12-23 01:01
Fan Zhang
阅读(134)
评论(0)
推荐(0)
摘要:
Queue<String> myQueue = new LinkedList<String>(); myQueue.add("A"); myQueue.add("B"); myQueue.add("C"); myQueue.add("D"); List<String> myList ... 阅读全文
posted @ 2009-12-23 00:55
Fan Zhang
阅读(158)
评论(0)
推荐(0)
摘要:
import java.util.ArrayList; import java.util.List; public class MainClass { public static void main(String[] args) { List stringList1 = new ArrayList(); stringList1.add("Java 5"); stringList... 阅读全文
posted @ 2009-12-23 00:38
Fan Zhang
阅读(138)
评论(0)
推荐(0)