¹ØÓÚ Java ¶ÔÏóÐòÁл¯Äú²»ÖªµÀµÄ 5 ¼þÊÂ
ÊýÄêǰ£¬µ±ºÍÒ»¸öÈí¼þÍŶÓÒ»ÆðÓà Java ÓïÑÔ±àдһ¸öÓ¦ÓóÌÐòʱ£¬ÎÒÌå»áµ½±ÈÒ»°ã³ÌÐòÔ±¶àÖªµÀÒ»µã¹ØÓÚ Java ¶ÔÏóÐòÁл¯µÄ֪ʶËù´øÀ´µÄºÃ´¦¡£
¹ØÓÚ±¾ÏµÁÐ
Äú¾õµÃ×Ô¼º¶® Java ±à³Ì£¿ÊÂʵÉÏ£¬´ó¶àÊý³ÌÐòÔ±¶ÔÓÚ Java ƽ̨¶¼ÊÇdz³¢ÔòÖ¹£¬Ö»Ñ§Ï°ÁË×ãÒÔÍê³ÉÊÖÍ·ÉÏÈÎÎñµÄ֪ʶ¶øÒÑ¡£
´óÔ¼Ò»Äêǰ£¬Ò»¸ö¸ºÔð¹ÜÀíÓ¦ÓóÌÐòËùÓÐÓû§ÉèÖõĿª·¢ÈËÔ±£¬¾ö¶¨½«Óû§ÉèÖô洢ÔÚÒ»¸ö Hashtable ÖУ¬È»ºó½«Õâ¸ö Hashtable ÐòÁл¯µ½´ÅÅÌ£¬ÒÔ±ã³Ö¾Ã»¯¡£µ±Óû§¸ü¸ÄÉèÖÃʱ£¬±ãÖØÐ½« Hashtable дµ½´ÅÅÌ¡£
ÕâÊÇÒ»¸öÓÅÑŵġ¢¿ª·ÅʽµÄÉèÖÃϵͳ£¬µ«ÊÇ£¬µ±ÍŶӾö¶¨´Ó Hashtable Ç¨ÒÆµ½ Java Collections ¿âÖÐµÄ HashMap ʱ£¬Õâ¸öϵͳ±ãÃæÁÙ±ÀÀ£¡£
Hashtable ºÍ HashMap ÔÚ´ÅÅÌÉϵĸñʽÊDz»Ïàͬ¡¢²»¼æÈݵġ£³ý·Ç¶Ôÿ¸ö³Ö¾Ã»¯µÄÓû§ÉèÖÃÔËÐÐijÖÖÀàÐ͵ÄÊý¾Ýת»»ÊµÓóÌÐò£¨¼«ÆäÅÓ´óµÄÈÎÎñ£©£¬·ñÔòÒÔºóËÆºõÖ»ÄÜÒ»Ö±Óà Hashtable ×÷ΪӦÓóÌÐòµÄ´æ´¢¸ñʽ¡£
ÍŶӸе½ÏÝÈ뽩¾Ö£¬µ«ÕâÖ»ÊÇÒòΪËûÃDz»ÖªµÀ¹ØÓÚ Java ÐòÁл¯µÄÒ»¸öÖØÒªÊÂʵ£ºJava ÐòÁл¯ÔÊÐíËæ×Åʱ¼äµÄÍÆÒÆ¶ø¸Ä±äÀàÐÍ¡£µ±ÎÒÏòËûÃÇչʾÈçºÎ×Ô¶¯½øÐÐÐòÁл¯Ìæ»»ºó£¬ËûÃÇÖÕÓÚ°´¼Æ»®Íê³ÉÁËÏò HashMap µÄת±ä¡£
±¾ÎÄÊDZ¾ÏµÁеĵÚһƪÎÄÕ£¬Õâ¸öϵÁÐרÃŽÒʾ¹ØÓÚ Java ƽ̨µÄһЩÓÐÓõÄС֪ʶ — ÕâЩС֪ʶ²»Ò×Àí½â£¬µ«¶ÔÓÚ½â¾ö Java ±à³ÌÌôÕ½³ÙÔçÓÐÓá£
½« Java ¶ÔÏóÐòÁл¯ API ×÷Ϊ¿ª¶ËÊÇÒ»¸ö²»´íµÄÑ¡Ôñ£¬ÒòΪËü´ÓÒ»¿ªÊ¼¾Í´æÔÚÓÚ JDK 1.1 ÖС£±¾ÎĽéÉܵĹØÓÚÐòÁл¯µÄ 5 ¼þÊÂÇ齫˵·þÄúÖØÐÂÉóÊÓÄÇЩ±ê×¼ Java API¡£
Java ÐòÁл¯¼ò½é
Java ¶ÔÏóÐòÁл¯ÊÇ JDK 1.1 ÖÐÒýÈëµÄÒ»×鿪´´ÐÔÌØÐÔÖ®Ò»£¬ÓÃÓÚ×÷ΪһÖÖ½« Java ¶ÔÏóµÄ״̬ת»»Îª×Ö½ÚÊý×飬ÒÔ±ã´æ´¢»ò´«ÊäµÄ»úÖÆ£¬ÒÔºó£¬ÈÔ¿ÉÒÔ½«×Ö½ÚÊý×éת»»»Ø Java ¶ÔÏóÔÓеÄ״̬¡£
ʵ¼ÊÉÏ£¬ÐòÁл¯µÄ˼ÏëÊÇ “¶³½á” ¶ÔÏó״̬£¬´«Êä¶ÔÏó״̬£¨Ð´µ½´ÅÅÌ¡¢Í¨¹ýÍøÂç´«ÊäµÈµÈ£©£¬È»ºó “½â¶³” ״̬£¬ÖØÐ»ñµÃ¿ÉÓÃµÄ Java ¶ÔÏó¡£ËùÓÐÕâЩÊÂÇéµÄ·¢ÉúÓеãÏñÊÇħÊõ£¬ÕâÒª¹é¹¦ÓÚ ObjectInputStream/ObjectOutputStream Àà¡¢ÍêÈ«±£ÕæµÄÔªÊý¾ÝÒÔ¼°³ÌÐòÔ±Ô¸ÒâÓà Serializable ±êʶ½Ó¿Ú±ê¼ÇËûÃǵÄÀ࣬´Ó¶ø “²ÎÓë” Õâ¸ö¹ý³Ì¡£
Çåµ¥ 1 ÏÔʾһ¸öʵÏÖ Serializable µÄ Person Àà¡£
Çåµ¥ 1. Serializable Person
package com.tedneward;
public class Person
implements java.io.Serializable
{
public Person(String fn, String ln, int a)
Ïà¹ØÎĵµ£º
1 . 1 2 . 1 ²»ÒªÃÔʧ
ÔÚÕû¸ö¿ª·¢¹ý³ÌÖУ¬×îÖØÒªµÄÊÂÇé¾ÍÊÇ£º²»Òª½«×Ô¼ºÃÔʧ£¡µ«ÊÂʵÉÏÕâÖÖÊÂÇéºÜÈÝÒ×·¢Éú¡£´ó¶àÊý·½·¨¶¼Éè
¼ÆÓÃÀ´½â¾ö×î´ó·¶Î§ÄÚµÄÎÊÌâ¡£µ±È»£¬Ò²´æÔÚÒ»Ð©ÌØ±ðÀ§ÄѵÄÏîÄ¿£¬ÐèÒª×÷Õ߸¶³ö¸üΪ¼èÐÁµÄŬÁ¦£¬»òÕ߸¶
³ö¸ü´óµÄ´ú¼Û¡£µ«ÊÇ£¬´ó¶àÊýÏîÄ¿¶¼ÊDZȽϓ³£¹æ”µÄ£¬ËùÒÔÒ»°ã¶¼ÄÜ×÷³ö³É¹¦µÄ·ÖÎö ......
import java.io.File;
public class FileTest{
public static void main(String[] args){
scan("c:/file/ss");
}
public static void scan(String path){
if(path ==null)
return ;
File file = new File(path); //É ......
Õâ¸öÃÕÌâÖ®ËùÒÔ±»³ÆÎª³¤Õû³ýÊÇÒòΪËüËùÉæ¼°µÄ³ÌÐòÊÇÓйØÁ½¸ölongÐÍÊýÖµÕû³ýµÄ¡£±»³ýÊý±íʾµÄÊÇÒ»ÌìÀïµÄ΢ÃëÊý£»¶ø³ýÊý±íʾµÄÊÇÒ»ÌìÀïµÄºÁÃëÊý¡£Õâ¸ö³ÌÐò»á´òÓ¡³öÊ²Ã´ÄØ£¿
public class LongDivision{
public static void main(String args[]){
final long MICROS_PER_DAY = 24 * 60 * 60 * 1000 * 1000;
final lo ......
´ð°¸Òþ²ØÁË£¬Ctrl+AÏÔʾ¡£½¨ÒéÏÈ˼¿¼Ò»Ï½á¹û£¬È»ºóÔËÐдúÂëÊÔÑé¡£Ò²ÐíÄã»á»ÐÈ»´óÎò¡£
1¡¢ÕÒÆæÊý£º
view plaincopy to clipboardprint?
public static boolean isOdd(int i){
return i % 2 == 1;
}
public static boolean isOdd(int i){
return i % 2 == 1;
}
ÉÏÃæµÄ·½·¨ÕæµÄÄÜÕÒµ ......
jdk/binĿ¼ÏÂnative2ascii.exeÎļþ¿ÉÒÔÖ±½Ó½«ÖÐÎÄת³Éunicode.
cmd½øµ½binĿ¼Ï£¬ÔËÐÐnative2ascii.exe¡£ÊäÈëÖÐÎĻسµºó¾ÍÉú³ÉÁËunicode±àÂë¡£
Ö±½ÓË«»÷ÔËÒ²ÐУ¬ÎÒÔÚCMDÏÂÔËÐÐÖ÷ÒªÊÇΪÁË·½±ã½«×ª»»ºóµÄ±àÂ뿽±´³öÀ´¡£
Àý£º
cmd
cd C:\Java\jdk1.5.0_17
C:\Java\jdk1.5.0_17>native2ascii
Ó¬Âñ²Ø &nb ......