java ËÄÖÖ±éÀúListµÄ·½·¨¼°±È½Ï
java ËÄÖÖ±éÀúListµÄ·½·¨¼°±È½Ï
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ListTest {
public static void main(String args[]){
List<Long> lists = new ArrayList<Long>();
for(Long i=0l;i<1000000l;i++){
lists.add(i);
}
Long oneOk = oneMethod(lists);
Long twoOk = twoMethod(lists);
Long threeOk = threeMethod(lists);
Long fourOk = fourMethod(lists);
System.out.println("One:" + oneOk);
System.out.println("Two:" + twoOk);
System.out.println("Three:" + threeOk);
System.out.println("four:" + fourOk);
}
public static Long oneMethod(List<Long> lists){
Long timeStart = System.currentTimeMillis();
for(int i=0;i<lists.size();i++) {
System.out.println(lists.get(i));
}
Long timeStop = System.currentTimeMillis();
return timeStop -timeStart ;
}
public static Long twoMethod(List<Long> lists){
Long timeStart = System.currentTimeMillis();
for(Long string : lists) {
System.out.println(string);
}
Long timeStop = System.currentTimeMillis();
return timeStop -timeStart ;
}
public static Long threeMethod(List<Long> lists){
Long timeStart = System.currentTimeMillis();
Iterator<Long> it = lists.iterator();
while (it.hasNext())
{
System.out.println(it.next());
}
Long timeStop = System.currentTimeMillis();
return timeStop -timeStart ;
}
public static Long fourMethod(List<Long> lists){
Long timeStart = System.currentTimeMillis();
for(Iterator<Long> i = lists.iterator(); i.hasNext();)
Ïà¹ØÎĵµ£º
¡¡Java Card Ó¦ÓóÌÐòµÄÔªËØ
¡¡¡¡Çë¼Çס£¬Java Card Ó¦ÓóÌÐò²¢²»ÊǶÀÁ¢µÄ£¬¶øÊǶ˵½¶ËÓ¦ÓóÌÐòµÄÒ»²¿·Ö:
ͼ 1. Java Card Ó¦ÓóÌÐòµÄµäÐÍ×é¼þ
¡¡¡¡Java Card Ó¦ÓóÌÐòͨ³£ÓÉÒÔϲ¿·Ö×é³É£º
¡¡¡¡Ìṩºǫ́·þÎñ£¨ÀýÈç±£´æÔÚÊý¾Ý¿âÖеݲȫ»òÕßµç×ÓÖ§¸¶ÐÅÏ¢£©·ÃÎ浀 ºǫ́ӦÓóÌÐò¡£ÈçºÎ¿ª·¢ºǫ́ӦÓóÌÐò³¬³öÁ˱¾Îĵ ......
ÕûÀíÁËһϳ£Óõ½µÄJava¿¨¿ª·¢°üÀïµÄ·½·¨£¬ÒÔºó¾ÍÄܼӿ쿪·¢ËÙ¶ÈÁË¡£
//Java Card¿ª·¢·½·¨²éѯ
import java.lang.*;
import javacard.framework.*;
import javacard.security.*;
import javacardx.crypto.*; //¸Ã°üΪÀ©Õ¹°ü
//install·½·¨
public static void install(byte[] bArray, ......
JDK1.4ÖÐ
Map map = new HashMap();
Iterator it = map.entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
Object key = entry.getKey();
Object value = entry.getValue();
}
JDK1.5ÖÐ,Ó¦ÓÃÐÂÌØÐÔFor-EachÑ»·
Map m = new HashMap();
......
java Ñ»·´òÓ¡³öij¶ÔÏóËùÔÚÀàµÄÀàÃûºÍ·½·¨
public class A {
public void b(){}
public void c(){}
public void d(){}
public void e(){}
}
import java.lang.reflect.*;
public class StaticTest {
public static void test(Object obj)
{
Class myclass = obj.getClass();
//System.out.prin ......
RMI£¨Remote Method Invocation£©
RMIÊÇ·Ö²¼Ê½¶ÔÏóÈí¼þ°ü£¬Ëü¼ò»¯ÁËÔÚ¶ą̀¼ÆËã»úÉϵÄJAVAÓ¦ÓÃÖ®¼äµÄͨÐÅ¡£
±ØÐëÔÚjdk1.1ÒÔÉÏ
RMIÓõ½µÄÀà
java.rmi.Remote ËùÓпÉÒÔ±»Ô¶³Ìµ÷ÓõĶÔÏó¶¼±ØÐëʵÏָýӿÚ
java.rmi.server.UnicastRemoteObject ËùÓпÉÒÔ±»Ô¶³Ìµ÷ÓõĶÔÏó¶¼±ØÐëÀ©Õ¹¸ÃÀà
ʲôÊÇRMI
Ô¶³Ì·½·¨µ÷ÓÃÊÇ ......