java¼¯ºÏ¿ò¼Üͼ¼°½éÉÜ
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(): ɾ³ý¼¯ºÏÖÐËùÓÐÔªËØ
void removeAll(Collection c) : ´Ó¼¯ºÏÖÐɾ³ý¼¯ºÏc ÖеÄËùÓÐÔªËØ
void retainAll(Collection c) : ´Ó¼¯ºÏÖÐɾ³ý¼¯ºÏc Öв»°üº¬µÄÔªËØ
(4) Collectionת»»ÎªObjectÊý×é £º
Object[] toArray() £º·µ»ØÒ»¸öÄÚº¬¼¯ºÏËùÓÐÔªËصÄarray
Object[] toArray(Object[] a) £º·µ»ØÒ»¸öÄÚº¬¼¯ºÏËùÓÐÔªËصÄarray¡£ÔËÐÐÆÚ·µ»ØµÄarrayºÍ²ÎÊýaµÄÐͱðÏàͬ£¬ÐèҪת»»ÎªÕýÈ·Ðͱð¡£
´Ë
Ïà¹ØÎĵµ£º
×î½üÑо¿ÁËÏ·ÖÒ³£¬×ö¸ö×ܽᡣ
1£©Êý¾Ý¿â²Ù×÷Àà,×ö¼òµ¥·â×° DB.java
package Test;
import java.sql.*;
public class DB {
// ¼ÓÔØÇý¶¯
static {
try {
Class.f ......
ÔÚËùÓеÄJavaÊé¼®µ±ÖУ¬Æäʵ×î×îÓÐÓõģ¬²¢²»ÊÇO′reillyµÄ Java Serials£¬ÕæÕý×î×îÓÐÓô¦ÊÇJDKµÄÎĵµation£¡¼¸ºõÄãÏë»ñµÃµÄËùÓеÄ֪ʶÔÚÎĵµationÀïÃæÈ«²¿¶¼ÓУ¬ÆäÖÐ×îÖ÷ÒªµÄ²¿·Öµ±È»ÊÇJava»ù´¡Àà¿âµÄAPIÎĵµ£¬ÊÇ°´ÕÕpackageÀ´×éÖ¯µÄ£¬¶ÔÓÚÿһ¸öclass¶¼ÓÐÏêϸµÄ½âÊÍ£¬ËüµÄ¼Ì³Ð¹Øϵ£¬ÊÇ·ñʵÏÖÁËij¸ö½Ó¿Ú£¬Í¨³£ÓÃÔÚÄÄÐ ......
ѧϰJava±Ø¿´ - JAVA´úÂë±àдµÄ30Ìõ½¨Òé
(1) ÀàÃûÊ××ÖĸӦ¸Ã´óд¡£×ֶΡ¢·½·¨ÒÔ¼°¶ÔÏ󣨾ä±ú£©µÄÊ××ÖĸӦСд¡£¶ÔÓÚËùÓбêʶ·û£¬ÆäÖаüº¬µÄËùÓе¥´Ê¶¼Ó¦½ô¿¿ÔÚÒ»Æ𣬶øÇÒ´óдÖм䵥´ÊµÄÊ××Öĸ¡£ÀýÈ磺
ThisIsAClassName
thisIsMethodOrFieldName
ÈôÔÚ¶¨ÒåÖгöÏÖÁ˳£Êý³õʼ»¯ ......
ÔÚ²âÊÔ
ConsoleRunner
µÄ¹ý³ÌÖз¢ÏÖÒ»¸öÓÐÒâ˼µÄÏÖÏó£¬Ò»¶ÎºÜ¼òµ¥µÄ
C
³ÌÐò£º
#include <stdio.h>
#include <windows.h>
int main() {
int i = 0;
for (;;) {
printf("%d\n", i++); ......
AnnotationÊÇJava5¡¢6Ö»ºóµÄÐÂÌØÕ÷£¨ÖÐÎijÆ֮Ϊע½â£©£¬²¢ÇÒÔ½À´Ô½¶àµÄµÃµ½ÁËÓ¦Ó㬱ÈÈçSpring¡¢Hibernate3¡¢Struts2¡¢iBatis3¡¢JPA¡¢JUnitµÈµÈ¶¼µÃµ½Á˹㷺ӦÓã¬Í¨¹ýʹÓÃ×¢½â£¬´úÂëµÄÁé»îÐÔ´ó´óÌá¸ß¡£
ÕâЩ¶¼ÊÇʹÓñðÈ˶¨ÒåµÄ×¢½â£¬Ò»°ã×¢½âµÄʹÓö¼ÊÇÔÚһЩ»ù´¡¿ò¼Ü»òÕßÀà¿âÖÐÀ´¶¨ÒåµÄ£¬Òò´ËºÜÉÙ¼û¹ýÓÐÈ ......