Java¼¯ºÏ¿ò¼ÜÈ«Ãæ½éÉÜ
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(): ɾ³ý¼¯ºÏÖÐËùÓÐÔªË
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
ѧϰǰÁ˽â
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJDKÊÇSun¹«Ë¾·¢²¼µÄJDK£¬³ýÁËSunÖ®Í⣠......
Õ⼸Ì죬ÔÚÍøÉÏËÑÁ˺ܶà¹ØÓÚjavaµÄ¶«Î÷£¬ÏÖÔÚ¸ø´ó¼Ò×ܽáһϣ¬·Ç³£ÓÐÓÃŶ£¬ºÜ¶à¶«Î÷ÎÒÃÇÔÚ¹úÄÚÊÇÎÞ·¨Á˽⵽µÄ
java³ÌÐòÔ±±ØÈ¥µÄ¹úÍâÍøÕ¾
http://www.onjava.com
ÿÖܶ¼ÓÐÐÂÎÄÕ·¢±í
http://www.developer.com/java
ÓÉGamelan.com ά»¤µÄJava¼¼ÊõÎÄÕÂÍøÕ¾
http://www.java.net
Sun¹«Ë¾Î¬»¤µÄÒ»¸öJavaÉçÇøÍøÕ¾
http:/ ......
1. import java.util.*;
2.(A) public class Test
{ public static void main(String[] args)
{
//Éú³É [0-n) ¸ö²»Öظ´µÄËæ»úÊý st ÓÃÀ´±£´æ ......
·´ÉäÊÇJavaÓïÑÔÖкÜÖØÒªµÄÒ»¸ö×é³É²¿·Ö£¬ËùÒԾʹ˻°ÌâÌÖÂÛµÄ×ÊÔ´¿ÉνÊýÖ®²»¾¡£¬ÈÕ³£¿ª·¢Ò²»á¾³£Ê¹Óõ½¹ØÓÚ·´ÉäµÄReflection
API¡£Java5.0
Tiger³öÏÖÒԺ󣬸ü¶Ô·´ÉäAPIÓÐÁËеÄÀ©Õ¹£¬¾¡¹ÜÌÖÂ۵Ļ°ÌâºÜ¶à£¬²»¹ýÎÒ»¹ÊǾõµÃ²»¹»È«Ã棬ÓÈÆäÊǶԷºÐÍÕâÒ»¿é£¬ËùÒÔ¾ÍÎÒËùÖª£¬ÔÙ»¨Á¦Æø×ܽáÒ»·¬
Ê×ÏÈ·´ÉäµÄÈë¿ÚÊÇ´ÓClass¿ ......