java¼¯ºÏ¿ò¼Üͼ¼°½éÉÜ
java¼¯ºÏ¿ò¼Üͼ¼°½éÉÜ
ת×Ô:http://hi.baidu.com/%C9%AE_%CC%C6/blog/item/9e2a8b0887008a8ad0581b3d.html
¼ò»¯Í¼£º
Javaƽ̨ÌṩÁËÒ»¸öȫеļ¯ºÏ¿ò¼Ü¡£“¼¯ºÏ¿ò¼Ü”Ö÷ÒªÓÉÒ»×éÓÃÀ´²Ù×÷¶ÔÏóµÄ½Ó¿Ú×é³É¡£²»Í¬½Ó¿ÚÃèÊöÒ»×鲻ͬÊý¾ÝÀàÐÍ¡£
Java 2¼¯ºÏ¿ò¼Üͼ
¼¯ºÏ½Ó¿Ú£º6¸ö½Ó¿Ú£¨¶ÌÐéÏß±íʾ£©£¬±íʾ²»Í¬¼¯ºÏÀàÐÍ£¬ÊǼ¯ºÏ¿ò¼ÜµÄ»ù´¡¡£
³éÏóÀࣺ5¸ö³éÏóÀࣨ³¤ÐéÏß±íʾ£©£¬¶Ô¼¯ºÏ½Ó¿ÚµÄ²¿·ÖʵÏÖ¡£¿ÉÀ©Õ¹Îª×Ô¶¨Ò弯ºÏÀà¡£
ʵÏÖÀࣺ8¸öʵÏÖÀࣨʵÏß±íʾ£©£¬¶Ô½Ó¿ÚµÄ¾ßÌåʵÏÖ¡£
Ôںܴó³Ì¶ÈÉÏ£¬Ò»µ©ÄúÀí½âÁ˽ӿڣ¬Äú¾ÍÀí½âÁË¿ò¼Ü¡£ËäÈ»Äú×ÜÒª´´½¨½Ó¿ÚÌض¨µÄʵÏÖ£¬µ«·ÃÎÊʵ¼Ê¼¯ºÏµÄ·½·¨Ó¦¸ÃÏÞÖÆÔÚ½Ó¿Ú·½·¨µÄʹÓÃÉÏ£»Òò´Ë£¬ÔÊÐíÄú¸ü¸Ä»ù±¾µÄÊý¾Ý½á¹¹¶ø²»±Ø¸Ä±äÆäËü´úÂë¡£
· Collection ½Ó¿ÚÊÇÒ»×éÔÊÐíÖظ´µÄ¶ÔÏó¡£
· Set ½Ó¿Ú¼Ì³Ð Collection£¬µ«²»ÔÊÐíÖظ´£¬Ê¹ÓÃ×Ô¼ºÄÚ²¿µÄÒ»¸öÅÅÁлúÖÆ¡£
· List ½Ó¿Ú¼Ì³Ð Collection£¬ÔÊÐíÖظ´£¬ÒÔÔªËØ°²²åµÄ´ÎÐòÀ´·ÅÖÃÔªËØ£¬²»»áÖØÐÂÅÅÁС£
· Map½Ó¿ÚÊÇÒ»×é³É¶ÔµÄ¼ü£Öµ¶ÔÏ󣬼´Ëù³ÖÓеÄÊÇkey-value pairs¡£MapÖв»ÄÜÓÐÖظ´µÄkey¡£ÓµÓÐ×Ô¼ºµÄÄÚ²¿ÅÅÁлúÖÆ¡£
· ÈÝÆ÷ÖеÄÔªËØÀàÐͶ¼ÎªObject¡£´ÓÈÝÆ÷È¡µÃÔªËØʱ£¬±ØÐë°ÑËüת»»³ÉÔÀ´µÄÀàÐÍ¡£
Java 2¼ò»¯¼¯ºÏ¿ò¼Üͼ
¼¯ºÏ½Ó¿Ú
1.Collection ½Ó¿Ú
ÓÃÓÚ±íʾÈκζÔÏó»òÔªËØ×é¡£ÏëÒª¾¡¿ÉÄÜÒÔ³£¹æ·½Ê½´¦ÀíÒ»×éÔªËØʱ£¬¾ÍʹÓÃÕâÒ»½Ó¿Ú¡£
(1) µ¥ÔªËØÌí¼Ó¡¢É¾³ý²Ù×÷£º
boolean add(Object o):½«¶ÔÏóÌí¼Ó¸ø¼¯ºÏ
boolean remove(Object o): Èç¹û¼¯ºÏÖÐÓÐÓëoÏàÆ¥ÅäµÄ¶ÔÏó£¬Ôòɾ³ý¶ÔÏóo
(2) ²éѯ²Ù×÷£º
int size() £º·µ»Øµ±Ç°¼¯ºÏÖÐÔªËصÄÊýÁ¿
boolean isEmpty() £ºÅжϼ¯ºÏÖÐÊÇ·ñÓÐÈκÎÔªËØ
boolean contains(Object o) £º²éÕÒ¼¯ºÏÖÐÊÇ·ñº¬ÓжÔÏóo
Iterator iterator() £º·µ»ØÒ»¸öµü´úÆ÷£¬ÓÃÀ´·ÃÎʼ¯ºÏÖеĸ÷¸öÔªËØ
(3) ×é²Ù×÷ £º×÷ÓÃÓÚÔªËØ×é»òÕû¸ö¼¯ºÏ
boolean containsAll(Collection c): ²éÕÒ¼¯ºÏÖÐÊÇ·ñº¬Óм¯ºÏc ÖÐËùÓÐÔªËØ
boolean addAll(Collection c) : ½«¼¯ºÏc ÖÐËùÓÐÔªËØÌí¼Ó¸ø¸Ã¼¯ºÏ
void clear(): ɾ³ý¼¯ºÏÖÐËùÓÐÔªËØ
void removeAll(Collection c) : ´Ó¼¯ºÏÖÐɾ³ý¼¯ºÏc ÖеÄËùÓÐÔªËØ
void retainAll(Collection c) : ´Ó¼¯ºÏÖÐɾ³ý¼¯ºÏc Öв»°üº¬µÄÔªËØ
(4) Collectionת»»ÎªObjectÊý×é £º
Object[] toArray() £º·µ»ØÒ»¸öÄÚº¬¼¯ºÏËùÓÐÔªËصÄarray
Object[] toArray(Object[] a) £º·µ»ØÒ»¸
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
Ï̵߳Ĵ´½¨ºÍÆô¶¯
javaÓïÑÔÒѾÄÚÖÃÁ˶àÏß³ÌÖ§³Ö£¬ËùÓÐʵÏÖRunnable½Ó¿ÚµÄÀ඼¿É±»Æô¶¯Ò»¸öÐÂỊ̈߳¬ÐÂÏ̻߳áÖ´ÐиÃʵÀýµÄrun()·½·¨£¬µ±run()·½·¨Ö´ÐÐÍê±Ïºó£¬Ï߳̾ͽáÊøÁË¡£Ò»µ©Ò»¸öÏß³ÌÖ´ÐÐÍê±Ï£¬Õâ¸öʵÀý¾Í²»ÄÜÔÙÖØÐÂÆô¶¯£¬Ö»ÄÜÖØÐÂÉú³ÉÒ»¸öÐÂʵÀý£¬ÔÙÆô¶¯Ò»¸öÐÂÏ̡߳£
......
1.Java Ô´ÎļþÖÐ×î¶àÖ»ÄÜÓÐÒ»¸ö£¨£©À࣬ÆäËûÀàµÄ¸öÊý²»ÏÞ¡£
publicÀà,¶øÇÒÕâ¸öÀàµÄÀàÃûÒªºÍÎļþÃûÒ»ÖÂ.
2.ÃæÏò¶ÔÏó³ÌÐòÉè¼ÆµÄÌØÕ÷£¨·â×°ÐÔ£©£¨¼Ì³Ð£©£¨¶à̬ÐÔ£©
3.½Ó¿ÚÊÇÓÉ£¨³éÏó·½·¨£©ºÍ£¨³£Á¿£©×é³ÉµÄÌØÊâÀà
4.ÓÃstaticÐÞÊεķ½·¨ÊÇ£¨¾²Ì¬·½·¨£¬»òÀà·½·¨£©
5.ÔÚ²úÉúÒì³£µÄ·½·¨ÉùÃ÷ÖÐÉùÃ÷»á²úÉúµÄ ......
³éÏ󻯺ͼ̳йØϵʹ¸ÅÄîºÍ¶¨Òå¿ÉÒÔ¸´Ó㻶à̬ÐÔʹʵÏÖºÍÓ¦ÓÿÉÒÔ¸´Óã»
¿ª±ÕÔÔò£¨Open-Closed Principle OCP£©Ò»¸öÈí¼þʵÌåÓ¦µ±¶ÔÀ©Õ¹¿ª·Å£¬¶ÔÐ޸ķâ±Õ¡£
¶Ô¿É±äÐԵķâ×°ÔÔò£¨Principle of Encapsulation of Variation£© (1)Ò»Öֱ仯ÐÔ²»ºÍÁíÒ»ÖÖ»ìºÏÔÚÒ»Æ𠣨2£©Ò»ÖֿɱäÐÔ²»Ó¦É¢ÂäÔÚ´úÂëµÄºÜ¶àµØ·½¡£
ÀïÊÏ´ú»» ......
¹ØÓÚJavaÕ»Óë¶ÑµÄ˼¿¼
1. Õ»(stack)Óë¶Ñ(heap)¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
¡¡¡¡2. Õ»µÄÓÅÊÆÊÇ£¬´æÈ¡ËٶȱȶÑÒª¿ì£¬½ö´ÎÓÚÖ±½ÓλÓÚCPUÖеļĴæÆ÷¡£µ«È±µãÊÇ£¬´æÔÚÕ»ÖеÄÊý¾Ý´óСÓëÉú´æÆÚ±ØÐëÊÇÈ·¶¨µÄ£¬È±·¦Áé»îÐÔ¡£ÁíÍ⣬ջÊý¾Ý¿ÉÒÔ¹²Ïí£¬Ïê¼ûµÚ3µ ......