JAVAÕ»ºÍ¶ÑµÄÇø±ð
ÔÎÄÀ´×Ô£ºIT¹¤³Ì¼¼ÊõÍø£¬www.systhinker.com
Õ»Óë¶Ñ¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
Õ»Óë¶Ñ¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
JavaµÄ¶ÑÊÇÒ»¸öÔËÐÐʱÊý¾ÝÇø,ÀàµÄ¶ÔÏó´ÓÖзÖÅä¿Õ¼ä¡£ÕâЩ¶ÔÏóͨ¹ýnew¡¢newarray¡¢anewarrayºÍmultianewarrayµÈÖ¸ÁÁ¢£¬ËüÃDz»ÐèÒª³ÌÐò´úÂëÀ´ÏÔʽµÄÊÍ·Å¡£¶ÑÊÇÓÉÀ¬»ø»ØÊÕÀ´¸ºÔðµÄ£¬¶ÑµÄÓÅÊÆÊÇ¿ÉÒÔ¶¯Ì¬µØ·ÖÅäÄÚ´æ´óС£¬Éú´æÆÚÒ²²»±ØÊÂÏȸæËß±àÒëÆ÷£¬ÒòΪËüÊÇÔÚÔËÐÐʱ¶¯Ì¬·ÖÅäÄÚ´æµÄ£¬JavaµÄÀ¬»øÊÕ¼¯Æ÷»á×Ô¶¯ÊÕ×ßÕâЩ²»ÔÙʹÓõÄÊý¾Ý¡£µ«È±µãÊÇ£¬ÓÉÓÚÒªÔÚÔËÐÐʱ¶¯Ì¬·ÖÅäÄڴ棬´æÈ¡ËٶȽÏÂý¡£
Õ»µÄÓÅÊÆÊÇ£¬´æÈ¡ËٶȱȶÑÒª¿ì£¬½ö´ÎÓڼĴæÆ÷£¬Õ»Êý¾Ý¿ÉÒÔ¹²Ïí¡£µ«È±µãÊÇ£¬´æÔÚÕ»ÖеÄÊý¾Ý´óСÓëÉú´æÆÚ±ØÐëÊÇÈ·¶¨µÄ£¬È±·¦Áé»îÐÔ¡£Õ»ÖÐÖ÷Òª´æ·ÅһЩ»ù±¾ÀàÐ͵ıäÁ¿£¨,int, short, long, byte, float, double, boolean, char£©ºÍ¶ÔÏó¾ä±ú¡£
Õ»ÓÐÒ»¸öºÜÖØÒªµÄÌØÊâÐÔ£¬¾ÍÊÇ´æÔÚÕ»ÖеÄÊý¾Ý¿ÉÒÔ¹²Ïí¡£¼ÙÉèÎÒÃÇͬʱ¶¨Ò壺
int a = 3;
int b = 3£»
±àÒëÆ÷ÏÈ´¦Àíint a = 3£»Ê×ÏÈËü»áÔÚÕ»Öд´½¨Ò»¸ö±äÁ¿ÎªaµÄÒýÓã¬È»ºó²éÕÒÕ»ÖÐÊÇ·ñÓÐ3Õâ¸öÖµ£¬Èç¹ûûÕÒµ½£¬¾Í½«3´æ·Å½øÀ´£¬È»ºó½«aÖ¸Ïò3¡£½Ó×Å´¦Àíint b = 3£»ÔÚ´´½¨ÍêbµÄÒýÓñäÁ¿ºó£¬ÒòΪÔÚÕ»ÖÐÒѾÓÐ3Õâ¸öÖµ£¬±ã½«bÖ±½ÓÖ¸Ïò3¡£ÕâÑù£¬¾Í³öÏÖÁËaÓëbͬʱ¾ùÖ¸Ïò3µÄÇé¿ö¡£
Õâʱ£¬Èç¹ûÔÙÁîa=4£»ÄÇô±àÒëÆ÷»áÖØÐÂËÑË÷Õ»ÖÐÊÇ·ñÓÐ4Öµ£¬Èç¹ûûÓУ¬Ôò½«4´æ·Å½øÀ´£¬²¢ÁîaÖ¸Ïò4£»Èç¹ûÒѾÓÐÁË£¬ÔòÖ±½Ó½«aÖ¸ÏòÕâ¸öµØÖ·¡£Òò´ËaÖµµÄ¸Ä±ä²»»áÓ°Ïìµ½bµÄÖµ¡£
ҪעÒâÕâÖÖÊý¾ÝµÄ¹²ÏíÓëÁ½¸ö¶ÔÏóµÄÒýÓÃͬʱָÏòÒ»¸ö¶ÔÏóµÄÕâÖÖ¹²ÏíÊDz»Í¬µÄ£¬ÒòΪÕâÖÖÇé¿öaµÄÐ޸IJ¢²»»áÓ°Ïìµ½b, ËüÊÇÓɱàÒëÆ÷Íê³ÉµÄ£¬ËüÓÐÀûÓÚ½ÚÊ¡¿Õ¼ä¡£¶øÒ»¸ö¶ÔÏóÒýÓñäÁ¿ÐÞ¸ÄÁËÕâ¸ö¶ÔÏóµÄÄÚ²¿×´Ì¬£¬»áÓ°Ïìµ½ÁíÒ»¸ö¶ÔÏóÒýÓñäÁ¿¡£
StringÊÇÒ»¸öÌØÊâµÄ°ü×°ÀàÊý¾Ý¡£¿ÉÒÔÓãº
String str = new String("abc");
String str = "abc";
Á½ÖÖµÄÐÎʽÀ´´´½¨£¬µÚÒ»ÖÖÊÇÓÃnew()À´Ð½¨¶ÔÏóµÄ£¬Ëü»áÔÚ´æ·ÅÓÚ¶ÑÖС£Ã¿µ÷ÓÃÒ»´Î¾Í»á´´½¨Ò»¸öеĶÔÏ󡣶øµÚ¶þÖÖÊÇÏÈÔÚÕ»Öд´½¨Ò»¸ö¶ÔStringÀàµÄ¶ÔÏóÒýÓñäÁ¿str£¬È»ºó²éÕÒÕ»ÖÐÓÐûÓдæ·Å"abc"£¬Èç¹ûûÓУ¬Ôò½«"abc"´æ·Å½øÕ»£¬²¢ÁîstrÖ¸Ïò”abc”£¬Èç¹ûÒѾÓДabc” ÔòÖ±½ÓÁîstrÖ¸Ïò“abc”¡£
±È½ÏÀàÀïÃæµÄÊýÖµÊÇ·ñÏàµÈʱ£¬ÓÃequals()·
Ïà¹ØÎĵµ£º
import java.io.*;
public class TestMusic{
private AudioFormat format;
private byte[] samples;
public static void main(String args[])throws Exception{
TestMusic sound =new TestMusic("1.wav");
InputStream stream =new ByteArrayInputStre ......
JAVAµÄÈÝÆ÷---List,Map,Set
Collection
©ÀList
©¦©ÀLinkedList
©¦©ÀArrayList
©¦©¸Vector
©¦¡¡©¸Stack
©¸Set
Map
©ÀHashtable
©ÀHashMap
©¸WeakHashMap
Collection½Ó¿Ú
¡¡¡¡CollectionÊÇ×î»ù±¾µÄ¼¯ºÏ½Ó¿Ú£¬Ò»¸öCollection´ú±íÒ»×éObject£¬¼´CollectionµÄÔªËØ£¨Elements£©¡£Ò»Ð© CollectionÔÊÐíÏà ......
½«Ä³ class ²úÉú³öÒ»¸ö instance Ö®ºó£¬´Ë class ËùÓÐµÄ instance field ¶¼»áÐÂÔöÒ»·Ý£¬ÄÇôËùÓÐµÄ instance method ÊÇ·ñÒ²»áÐÂÔöÒ»·Ý£¿´ð°¸ÊDz»»á£¬ÎÒÃÇÓÃfield±íʾ×ֶΣ¬ÓÃmethod±íʾ·½·¨£¬ÄÇô¼ÓÉÏstaticÇø·Öºó¾Í ÓÐËÄÖÖ£º
class field£ºÓÐÓÃstaticÐÞÊεÄfield
class method£ºÓÐÓÃstaticÐÞÊεÄmethod
instance fi ......
Design Patterns in Java
-----------------------------------------
Steven John Metsker
William C.Wake
-----------------------------------------
¹¨²¨µÈÒë
££££££££Ò»¡¢¶þÕ¶ÁÊé¼Ç¼££££££
ģʽÊǼ¯ÌåÖǻ۵Ľᾧ¡£Ëü¸ø³öÁËÏà¹ØÐÐÒµÖоÑé·á¸»µÄ´ÓÒµÕßËùÓ¦ÓõÄËùÓеĸÅÄîºÍ·½ ......