Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaÓÃforÑ­環Map


¸ù¾ÝJDK5µÄÐÂÌØÐÔ,ÓÃForÑ­»·Map,ÀýÈçÑ­»·MapµÄKey
Java´úÂë
for(String dataKey : paraMap.keySet())   {      
    System.out.println(dataKey );                 
}  
for(String dataKey : paraMap.keySet()) {
System.out.println(dataKey );
}
×¢ÒâµÄÊÇ,paraMap ÊÇÔõôÑù¶¨ÒåµÄ,Èç¹ûÊǼòµ¥µÄMap paraMap = new HashMap ();ÄÇÇ°ÃæµÄString¾ÍÖ»ÄÜ»»³ÉObjectÁË.
Ñ­環Õû個mapµÄkeyºÍvalue
Java´úÂë
Map<Integer,String> map = new LinkedHashMap<Integer,String>();   
map.put(1, "ÐÇÆÚÒ»");   
map.put(2, "ÐÇÆÚ¶þ");   
map.put(3, "ÐÇÆÚÈý");   
map.put(4, "ÐÇÆÚËÄ");   
map.put(5, "ÐÇÆÚÎå");   
map.put(6, "ÐÇÆÚÁù");   
map.put(7, "ÐÇÆÚÈÕ");   
  
for(Map.Entry<Integer, String> entry: map.entrySet()) {   
   System.out.print(entry.getKey() + ":" + entry.getValue() + "\t");   
}  
Map<Integer,String> map = new LinkedHashMap<Integer,String>();
map.put(1, "ÐÇÆÚÒ»");
map.put(2, "ÐÇÆÚ¶þ");
map.put(3, "ÐÇÆÚÈý");
map.put(4, "ÐÇÆÚËÄ");
map.put(5, "ÐÇÆÚÎå");
map.put(6, "ÐÇÆÚÁù");
map.put(7, "ÐÇÆÚÈÕ");
for(Map.Entry<Integer, String> entry: map.entrySet()) {
System.out.print(entry.getKey() + ":" + entry.getValue() + "\t");
}
輸³ö結¹û£º
1:ÐÇÆÚÒ» 2:ÐÇÆÚ¶þ 3:ÐÇÆÚÈý 4:ÐÇÆÚËÄ 5:ÐÇÆÚÎå 6:ÐÇÆÚÁù 7:ÐÇÆÚÈÕ


Ïà¹ØÎĵµ£º

·ÖÏíJavaÃæÊÔÖÐÓöµ½µÄһЩ¾­µäËã·¨ÌâÄ¿

1.дһ¸ö·½·¨£¬ÓÃÒ»¸öforÑ­»·´òÓ¡¾Å¾Å³Ë·¨±í
  /**
* ´òÓ¡¾Å¾Å³Ë·¨¿Ú¾÷±í
*/
public void nineNineMulitTable(){
for (int i = 1,j = 1; j <= 9; i++) {
System.out.print(i+"*"+j+"="+i*j+" ");
if(i==j){
i=0;
......

java£¬php£¬mysqlʱ¼ä´¦Àí

javaÖÐʱ¼ä´ÁºÍʱ¼ä×Ö·û´®Ö®¼äµÄת»»
»ñÈ¡µ±Ç°µÄunixʱ¼ä´Á
new Date().getTime()
System.currentTimeMillis()
·µ»ØµÄÊǺÁÃëÊý£¬Òª×ª»»long t = System.currentTimeMillis()/1000;
»ñÈ¡µ±Ç°ÄêÔÂÈÕÒÔ¼°Ê±·ÖÃë
Calendar c = Calendar.getInstance();
c.get(Calendar.YEAR))  c.get(Calendar.YEAR))  c.get(C ......

Java ¸ù¾Ý¹Ø¼ü×Öץȡgoogle ÐÂÎÅ ÍøÂçÊý¾Ý .*

 Óû§ÒªÇóͳ¼ÆËùÌṩ¹Ø¼ü×ÖÔÚÍøÂç³öÏÖµÄÐÂÎÅ£¬ÏÂÃæΪһ¸ö²âÊÔµÄmain·½·¨¡£
package com.net;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
impo ......

Java ±³¾°

 Ò»¡¢±³¾°
    ×î½üÒ»Äê¶àÀ´,ÔÚInternetÉϳöÏÖµÄÌرðÎüÒýÈ˵Äʼþ¾ÍÊÇJavaÓïÑÔºÍÓÃJava±àдµÄä¯ÀÀÆ÷HotJava¡£
1991Äê,SUNMicroSystem¹«Ë¾µÄJameGosling¡¢BillJoeµÈÈË,ΪÔÚµçÊÓ¡¢¿ØÖÆ¿¾Ãæ°üÏäµÈ¼ÒÓÃÏû·ÑÀàµç×Ó²úÆ·ÉϽøÐн»»¥Ê½²Ù×÷¶ø¿ª·¢ÁËÒ»¸öÃûΪOakµÄÈí¼þ(¼´Ò»ÖÖÏðÊ÷µÄÃû×Ö),µ«µ±Ê±²¢Ã»ÓÐÒýÆðÈËÃǵ ......

JAVA¶ÁÈ¡Îļþ£¬±ÜÃâÖÐÎÄÂÒÂë¡£

 1¡¢JAVA¶ÁÈ¡Îļþ£¬±ÜÃâÖÐÎÄÂÒÂë¡£
/**
* ¶ÁÈ¡ÎļþÄÚÈÝ
*
* @param filePathAndName
*            String Èç c:\\1.txt ¾ø¶Ô·¾¶
* @return boolean
*/
public static String readFile(String filePathAndName) {
   String fileContent ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ