import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.Set;
public class javaCode {
public static void main(String args[])
{
Set<String> charsetNames = Charset.availableCharsets().keySet();
System.out.println("-----the number of jdk1.67's charset is "+charsetNames.size()+"-----");
for (Iterator it = charsetNames.iterator(); it.hasNext();)
{
String charsetName = (String) it.next();
System.out.println(charsetName);
}
}
}
Ö´Ðнá¹û
-----the number of jdk1.67's charset is 160-----
Big5
Big5-HKSCS
EUC-JP
EUC-KR
GB18030
GB2312
GBK
IBM-Thai
IBM00858
IBM01140
IBM01141
IBM01142
IBM01143
IBM01144
IBM01145
IBM01146
IBM01147
IBM01148
IBM01149
IBM037
IBM1026
IBM1047
IBM273
IBM277
IBM278
IBM280
IBM284
IBM285
IBM297
IBM420
IBM424
IBM437
IBM500
IBM775
IBM850
IBM852
IBM855
IBM857
IBM860
IBM861
IBM862
IBM863
IBM864
IBM865
IBM866
IBM868
IBM869
IBM870
IBM871
IBM918
ISO-2022-CN ......
¡¡JavaÓïÑÔµÄÊäÈëÊä³ö¹¦ÄÜÊÇÊ®·ÖÇ¿´ó¶øÁé»îµÄ£¬ÃÀÖв»×ãµÄÊÇ¿´ÉÏÈ¥ÊäÈëÊä³öµÄ´úÂë²¢²»ÊǺܼò½à£¬ÒòΪÄãÍùÍùÐèÒª°ü×°Ðí¶à²»Í¬µÄ¶ÔÏó¡£ÔÚJavaÀà¿âÖУ¬IO²¿·ÖµÄÄÚÈÝÊǺÜÅÓ´óµÄ£¬ÒòΪËüÉæ¼°µÄÁìÓòºÜ¹ã·º:±ê×¼ÊäÈëÊä³ö£¬ÎļþµÄ²Ù×÷£¬ÍøÂçÉϵÄÊý¾ÝÁ÷£¬×Ö·û´®Á÷£¬¶ÔÏóÁ÷£¬zipÎļþÁ÷....±¾ÎĵÄÄ¿µÄÊÇΪ´ó¼Ò×öÒ»¸ö¼òÒªµÄ½éÉÜ¡£
¡¡¡¡Á÷ÊÇÒ»¸öºÜÐÎÏóµÄ¸ÅÄµ±³ÌÐòÐèÒª¶ÁÈ¡Êý¾ÝµÄʱºò£¬¾Í»á¿ªÆôÒ»¸öͨÏòÊý¾ÝÔ´µÄÁ÷£¬Õâ¸öÊý¾ÝÔ´¿ÉÒÔÊÇÎļþ£¬Äڴ棬»òÊÇÍøÂçÁ¬½Ó¡£ÀàËƵģ¬µ±³ÌÐòÐèҪдÈëÊý¾ÝµÄʱºò£¬¾Í»á¿ªÆôÒ»¸öͨÏòÄ¿µÄµØµÄÁ÷¡£ÕâʱºòÄã¾Í¿ÉÒÔÏëÏóÊý¾ÝºÃÏñÔÚÕâÆäÖГÁ÷”¶¯Ò»Ñù£¬ÈçÏÂͼ£º
¡¡¡¡JavaÖеÄÁ÷·ÖΪÁ½ÖÖ£¬Ò»ÖÖÊÇ×Ö½ÚÁ÷£¬ÁíÒ»ÖÖÊÇ×Ö·ûÁ÷£¬·Ö±ðÓÉËĸö³éÏóÀàÀ´±íʾ£¨Ã¿ÖÖÁ÷°üÀ¨ÊäÈëºÍÊä³öÁ½ÖÖËùÒÔÒ»¹²Ëĸö£©:InputStream£¬OutputStream£¬Reader£¬Writer¡£JavaÖÐÆäËû¶àÖÖ¶àÑù±ä»¯µÄÁ÷¾ùÊÇÓÉËüÃÇÅÉÉú³öÀ´µÄ:
¡¡¡¡ÔÚÕâÆäÖÐInputStreamºÍOutputStreamÔÚÔçÆÚµÄJava°æ±¾ÖоÍÒѾ´æÔÚÁË£¬ËüÃÇÊÇ»ùÓÚ×Ö½ÚÁ÷µÄ£¬¶ø»ùÓÚ×Ö·ûÁ÷µÄReaderºÍWriterÊǺóÀ´¼ÓÈë×÷Ϊ²¹³äµÄ¡£ÒÔÉϵIJã´ÎͼÊÇJavaÀà¿âÖеÄÒ»¸ö»ù±¾µÄ²ã´ÎÌåϵ¡£
¡¡¡¡ÔÚÕâËĸö³éÏóÀàÖУ¬InputStreamºÍReader¶¨ÒåÁËÍêÈ«Ïàͬ ......
Java¼ò½é
¡¡¡¡JavaÊÇÓÉSun Microsystems¹«Ë¾ÓÚ1995Äê5ÔÂÍƳöµÄJava³ÌÐòÉè¼ÆÓïÑÔ£¨ÒÔϼò³ÆJavaÓïÑÔ£©ºÍJavaƽ̨µÄ×ܳơ£ÓÃJavaʵÏÖµÄHotJavaä¯ÀÀÆ÷£¨Ö§³ÖJava applet£©ÏÔʾÁËJavaµÄ÷ÈÁ¦£º¿çƽ̨¡¢¶¯Ì¬µÄWeb¡¢Internet¼ÆËã¡£´Ó´Ë£¬Java±»¹ã·º½ÓÊܲ¢Íƶ¯ÁËWebµÄѸËÙ·¢Õ¹£¬³£ÓõÄä¯ÀÀÆ÷ÏÖÔÚ¾ùÖ§³ÖJava applet¡£ÁíÒ»·½Ã棬Java¼¼ÊõÒ²²»¶Ï¸üС£
¡¡¡¡Javaƽ̨ÓÉJavaÐéÄâ»ú£¨Java Virtual Machine£©ºÍJava Ó¦Óñà³Ì½Ó¿Ú£¨Application Programming Interface¡¢¼ò³ÆAPI£©¹¹³É¡£Java Ó¦Óñà³Ì½Ó¿ÚΪJavaÓ¦ÓÃÌṩÁËÒ»¸ö¶ÀÁ¢ÓÚ²Ù×÷ϵͳµÄ±ê×¼½Ó¿Ú£¬¿É·ÖΪ»ù±¾²¿·ÖºÍÀ©Õ¹²¿·Ö¡£ÔÚÓ²¼þ»ò²Ù×÷ϵͳƽ̨ÉÏ°²×°Ò»¸öJavaƽ̨֮ºó£¬JavaÓ¦ÓóÌÐò¾Í¿ÉÔËÐС£ÏÖÔÚJavaƽ̨ÒѾǶÈëÁ˼¸ºõËùÓеIJÙ×÷ϵͳ¡£ÕâÑùJava³ÌÐò¿ÉÒÔÖ»±àÒëÒ»´Î£¬¾Í¿ÉÒÔÔÚ¸÷ÖÖϵͳÖÐÔËÐС£JavaÓ¦Óñà³Ì½Ó¿ÚÒѾ´Ó1.1x°æ·¢Õ¹µ½1.2°æ¡£Ä¿Ç°³£ÓõÄJavaƽ̨»ùÓÚJava1.4£¬×î½ü°æ±¾ÎªJava1.7¡£
¡¡¡¡Java·ÖΪÈý¸öÌåϵJavaSE(Java2 Platform Standard Edition£¬javaƽ̨±ê×¼°æ)£¬JavaEE(Java 2 Platform,Enterprise Edition£¬javaƽ̨ÆóÒµ°æ)£¬JavaME(Java 2 Platform Micro Edition£¬javaƽ̨΢ÐÍ°æ)¡£
¡¡¡¡2009Äê04ÔÂ20ÈÕ£¬oracle£ ......
ÔÎÄ£ºhttp://zhaosoft.javaeye.com/blog/243586
Java
»ù±¾¸ÅÄ¼¯ºÏÀࣨCollection
£© List
/Set/Map µÄÇø±ðºÍÁªÏµ
Collection
£ºList
¡¢Set
Map£ºHashMap¡¢HashTable
ÈçºÎÔÚËüÃÇÖ®¼äÑ¡Ôñ
Ò»¡¢Array £¬ Arrays
Java
ËùÓГ´æ´¢¼°Ëæ»ú·ÃÎÊÒ»Á¬´®¶ÔÏó”µÄ×ö·¨£¬arrayÊÇ×îÓÐЧÂʵÄÒ»ÖÖ¡£
1¡¢Ð§Âʸߣ¬µ«ÈÝÁ¿¹Ì¶¨ÇÒÎÞ·¨¶¯Ì¬¸Ä±ä¡£
array»¹ÓÐÒ»¸öȱµãÊÇ£¬ÎÞ·¨ÅжÏÆäÖÐʵ¼Ê´æÓжàÉÙÔªËØ£¬lengthÖ»ÊǸæËßÎÒÃÇarrayµÄÈÝÁ¿¡£
2¡¢Java
ÖÐÓÐÒ»¸öArraysÀ࣬רÃÅÓÃÀ´²Ù×÷array¡£
arraysÖÐÓµÓÐÒ»×éstaticº¯Êý£¬equals()£º±È½ÏÁ½¸öarrayÊÇ·ñÏàµÈ¡£arrayÓµÓÐÏàͬԪËظöÊý£¬ÇÒËùÓжÔÓ¦ÔªËØÁ½Á½ÏàµÈ¡£
fill()£º½«ÖµÌîÈëarrayÖС£
sort()£ºÓÃÀ´¶Ôarray½øÐÐÅÅÐò¡£
binarySearch()£ºÔÚÅźÃÐòµÄarrayÖÐÑ°ÕÒÔªËØ¡£
System.arraycopy()£ºarrayµÄ¸´ÖÆ¡£
¶þ¡¢Collection
£¬ Map
Èô׫д³ÌÐòʱ²»ÖªµÀ¾¿¾¹ÐèÒª¶àÉÙ¶ÔÏó£¬ÐèÒªÔڿռ䲻×ãʱ×Ô¶¯À©ÔöÈÝÁ¿£¬ÔòÐèҪʹÓÃÈÝÆ÷Àà¿â£¬array²»ÊÊÓá£
1¡¢Collection
ºÍ Map µÄÇø±ð
ÈÝÆ÷ÄÚÿ¸öΪ֮Ëù´æ´¢µÄÔªËظöÊý²»Í¬¡£
Collection
ÀàÐÍÕߣ¬Ã¿¸öλÖÃÖ»ÓÐÒ»¸öÔªËØ¡£
MapÀàÐÍÕߣ¬³ÖÓÐ key-value ......
SpringÄÜÓÐЧµØ×éÖ¯J2EEÓ¦Óø÷²ãµÄ¶ÔÏó¡£²»¹ÜÊÇ¿ØÖƲãµÄAction¶ÔÏ󣬻¹ÊÇÒµÎñ²ãµÄService¶ÔÏ󣬻¹Êdz־òãµÄDAO¶ÔÏ󣬶¼¿ÉÔÚSpringµÄ¹ÜÀíÏÂÓлúµØе÷¡¢ÔËÐС£Spring½«¸÷²ãµÄ¶ÔÏóÒÔËÉñîºÏµÄ·½Ê½×éÖ¯ÔÚÒ»Æð£¬Action¶ÔÏóÎÞÐë¹ØÐÄService¶ÔÏóµÄ¾ßÌåʵÏÖ£¬Service¶ÔÏóÎÞÐë¹ØÐij־òã¶ÔÏóµÄ¾ßÌåʵÏÖ£¬¸÷²ã¶ÔÏóµÄµ÷ÓÃÍêÈ«ÃæÏò½Ó¿Ú¡£µ±ÏµÍ³ÐèÒªÖع¹Ê±£¬´úÂëµÄ¸ÄдÁ¿½«´ó´ó¼õÉÙ¡£
ÉÏÃæËù˵µÄÒ»Çж¼µÃÒËÓÚSpringµÄºËÐÄ»úÖÆ£¬ÒÀÀµ×¢Èë¡£ÒÀÀµ×¢ÈëÈÃbeanÓëbeanÖ®¼äÒÔÅäÖÃÎļþ×éÖ¯ÔÚÒ»Æ𣬶ø²»ÊÇÒÔÓ²±àÂëµÄ·½Ê½ñîºÏÔÚÒ»Æð¡£Àí½âÒÀÀµ×¢Èë
ÒÀÀµ×¢Èë(Dependency Injection)ºÍ¿ØÖÆ·´×ª(Inversion of Control)ÊÇͬһ¸ö¸ÅÄî¡£¾ßÌ庬ÒåÊÇ:µ±Ä³¸ö½ÇÉ«(¿ÉÄÜÊÇÒ»¸öJavaʵÀý£¬µ÷ÓÃÕß)ÐèÒªÁíÒ»¸ö½ÇÉ«(ÁíÒ»¸öJavaʵÀý£¬±»µ÷ÓÃÕß)µÄÐÖúʱ£¬ÔÚ´«Í³µÄ³ÌÐòÉè¼Æ¹ý³ÌÖУ¬Í¨³£Óɵ÷ÓÃÕßÀ´´´½¨±»µ÷ÓÃÕßµÄʵÀý¡£µ«ÔÚSpringÀ´´½¨±»µ÷ÓÃÕߵŤ×÷²»ÔÙÓɵ÷ÓÃÕßÀ´Íê³É£¬Òò´Ë³ÆΪ¿ØÖÆ·´×ª;´´½¨±»µ÷ÓÃÕßʵÀýµÄ¹¤×÷ͨ³£ÓÉSpringÈÝÆ÷À´Íê³É£¬È»ºó×¢Èëµ÷ÓÃÕߣ¬Òò´ËÒ²³ÆΪÒÀÀµ×¢Èë¡£
²»¹ÜÊÇÒÀÀµ×¢È룬»¹ÊÇ¿ØÖÆ·´×ª£¬¶¼ËµÃ÷Spring²ÉÓö¯Ì¬¡¢Áé»îµÄ·½Ê½À´¹ÜÀí¸÷ÖÖ¶ÔÏ󡣶ÔÏóÓë¶ÔÏóÖ®¼äµÄ¾ßÌåʵÏÖ»¥Ïà͸Ã÷¡£ÔÚÀí½âÒÀÀµ×¢ ......
´ó¼Ò¶¼ËµjavaʹÓõÄ×Ö·û¼¯ÊÇunicode£¬ÄÇôĬÈϱàÂë²»¾ÍÊÇÓ¦¸ÃÊÇUTF8,UTF16Ö®ÀàµÄunicode±àÂëÂð£¿
¿ÉÊǵ÷ÓÃCharset.defaultCharset()µÄ½á¹û²¢·ÇÈç´Ë¡£
import java.nio.charset.Charset;
public class javaCode {
public static void main(String args[])
{
String defaultCharsetName=Charset.defaultCharset().displayName();
System.out.println("defaultCharsetName:"+defaultCharsetName);
}
}
Ö´Ðнá¹ûÈçÏÂ
defaultCharsetName:GBK
¶à´ÎÊÔÑé·¢ÏÖ£¬Õâ¸öĬÈÏ×Ö·û±àÂëÊÇÓÉwindowsµÄÓïÑÔµØÓòÀïµÄÉ趨¾ö¶¨µÄ
Õâ¸ö×Ö·û±àÂë¿Ï¶¨²»ÊÇjavaÄÚ²¿µÄ×Ö·û±àÂ룬Äǻ᲻»áÊÇÎļþ¶ÁÈëʱµÄ×Ö·û±àÂ룿
ÏÈÓÃEmeditorÖ®ÀàµÄ±à¼Æ÷£¬Éú³ÉÒ»¸öUTF8µÄtxtÎļþ£¬ÊäÈëÄÚÈÝ£º門(door)£¬±£´æ¡£
ÓÃÏÂÃæµÄ´úÂë¶ÁÈë
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
public class javaCode {
public static void main(String args[])
{
String defaultCharsetName=Charset.defaultCha ......