java»ù´¡
1¡¢×÷ÓÃÓòpublic,private,protected,ÒÔ¼°²»Ð´Ê±µÄÇø±ð
×÷ÓÃÓò µ±Ç°Àà ͬһpackage ×ÓËïÀà ÆäËûpackage
public √ √ √ √
protected √ √ √ ×
²»Ð´Ê±Ä¬ÈÏΪfriendly √ √ × ×
private √ × × ×
2¡¢ArrayListºÍVectorµÄÇø±ð
Vector ÊÇḬ̈߳²È«µÄ£¬ArrayList²»ÊÇ£»ArrayListЧÂʸß
3¡¢HashMapºÍHashtableµÄÇø±ð
HashMapºÍHashtableµÄÇø±ð
1.HashtableÊÇḬ̈߳²È«µÄÒ»¸öCollection£¬ HashMap²»ÊÇḬ̈߳²È«µÄ
2.HashMapÔÊÐíÒ»¸önull keyºÍ¶à¸önull value ¶øhashtable²»ÔÊÐí
3.public class Hashtable extends Dictionary implements Map, Cloneable, Serializable (ʵÏÖµÄÊÇMap¶ø²»ÊÇSet)
public class HashMap extends AbstractMap implements Map, Cloneable, Serializable
4¡¢¶àÏß³ÌÓÐÁ½ÖÖʵÏÖ·½·¨£º
£¨1£©¼Ì³ÐThreadÀà,¸²¸Ç·½·¨ run()£¬ÎÒÃÇÔÚ´´½¨µÄ Thread ÀàµÄ×ÓÀàÖÐÖØÐ´ run() ,ÔÚ´Ë·½·¨ÖмÓÈëÏß³ÌËùÒªÖ´ÐеĴúÂë¼´¿É£º
£¨2£©ÊµÏÖRunnable½Ó¿Ú
Runnable ½Ó¿ÚÖ»ÓÐÒ»¸ö·½·¨ run()£¬ÎÒÃÇÉùÃ÷×Ô¼ºµÄÀàʵÏÖ Runnable ½Ó¿Ú²¢ÌṩÕâÒ»·½·¨£¬½«ÎÒÃǵÄÏ̴߳úÂëдÈëÆäÖУ¬¾ÍÍê³ÉÁËÕâÒ»²¿·ÖµÄÈÎÎñ¡£µ«ÊÇ Runnable ½Ó¿Ú²¢Ã»ÓÐÈκζÔÏ̵߳ÄÖ§³Ö£¬ÎÒÃÇ»¹±ØÐë´´½¨ Thread ÀàµÄʵÀý£¬ÕâÒ»µãͨ¹ý Thread ÀàµÄ¹¹Ô캯Êýpublic Thread(Runnable target);À´ÊµÏÖ
5¡¢Í¬²½ÓÐÁ½ÖÖʵÏÖ·½·¨£º
£¨1£©synchronized
£¨2£©wait,motify
6¡¢ÄÚ²¿ÀàÏà¹Ø
1.¾²Ì¬ÄÚ²¿Àà¿ÉÒÔÓо²Ì¬³ÉÔ±£¬¶ø·Ç¾²Ì¬ÄÚ²¿ÀàÔò²»ÄÜÓо²Ì¬³ÉÔ±¡£
2.¾²Ì¬ÄÚ²¿ÀàµÄ·Ç¾²Ì¬³ÉÔ±¿ÉÒÔ·ÃÎÊÍⲿÀàµÄ¾²Ì¬±äÁ¿£¬¶ø²»¿É·ÃÎÊÍⲿÀàµÄ·Ç¾²Ì¬±äÁ¿£»
3.·Ç¾²Ì¬ÄÚ²¿ÀàµÄ·Ç¾²Ì¬³ÉÔ±¿ÉÒÔ·ÃÎÊÍⲿÀàµÄ·Ç¾²Ì¬±äÁ¿¡£
7¡¢JAVAÖеÄCollection FrameWork
Collection
©ÀList
©¦©ÀLinkedList
©¦©ÀArrayList
©¦©¸Vector
©¦ ©¸Stack
©¸Set
CollectionÊÇ×î»ù±¾µÄ¼¯ºÏ½Ó¿Ú£¬Ò»¸öCollection´ú±íÒ»×éObject£¬¼´CollectionµÄÔªËØ£¨Elements£©
MapÌ
Ïà¹ØÎĵµ£º
//ÇóÁ½ÊýµÄ×î´ó¹«Ô¼ÊýºÍ×îС¹«±¶Êý
import java.util.*;
public class Dais02
{
public static void main(String args[])
{
int m,n;
Scanner s = new Scanner(System.in);
System.out.println("ÇëÊäÈëÄãÏëÒªÊÇÊý×Ö");
m = s.nextInt();
n ......
java»Øµ÷»úÖÆ£º
Èí¼þÄ£¿éÖ®¼ä×ÜÊÇ´æÔÚ×ÅÒ»¶¨µÄ½Ó¿Ú£¬´Óµ÷Ó÷½Ê½ÉÏ£¬¿ÉÒÔ°ÑËûÃÇ·ÖΪÈýÀࣺͬ²½µ÷Óᢻص÷ºÍÒì²½µ÷Óá£
ͬ²½µ÷ÓÃÊÇÒ»ÖÖ×èÈûʽµ÷Ó㬵÷Óà ·½ÒªµÈ´ý¶Ô·½Ö´ÐÐÍê±Ï²Å·µ»Ø£¬ËüÊÇÒ»ÖÖµ¥Ïòµ÷Óã»
»Øµ÷ÊÇÒ»ÖÖË«Ïòµ÷ÓÃģʽ£¬Ò²¾ÍÊÇ˵£¬±»µ÷Ó÷½ÔÚ½Ó¿Ú±»µ÷ÓÃʱҲ»áµ÷ÓöԷ½µÄ½Ó¿Ú£»
Òì²½µ÷ÓÃÊÇÒ»ÖÖÀàËÆÏûÏ¢»òʼþµÄ» ......
Õ⼸Ìì¿´ÁËÍøÉÏһЩǰ±²µÄ´úÂ룬×Ô¼º¶ÔJavaʵÏÖzipÎļþµÄ½âѹ£¬Ñ¹ËõÓÐÒ»µãÀí½â£¬¹ÊдÏÂÁô×ÅÒÔºó²Î¿¼¡£
ΪÁË´¦ÀíÖÐÎÄÂÒÂëÎÊÌ⣬ʹÓÃant.jar°ü¡£
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
......
java se£º
1.javaºËÐļ¼Êõ£¨µÚÆß°æ£©£¨ºÜºÃµÄÈëÃÅÊé¼®£¬ÓÐÁ½±¾£©
2.java±à³Ì˼Ï루µÚËİ棩£¨ÎÒ¿´¹ýµÚÈý°æ£¬µÚËİ濴ÁËÒ»µãÓ¢Îĵ쬾õµÃÕâ±¾Ê黹ÊÇÊʺÏÓлù´¡µÄjavaѧϰÕß¹®¹Ì»ù´¡£¬Ò²¾ÍÊÇ˵ҪÏë´òÀλù´¡¾Í¿´ÍêºËÐļ¼Êõ¿´Õâ¸ö~£©
3.java jdkʵÀý±¦µä£¨Õâ±¾ÊéÀX±¾°üº¬ÁËËùÓÐÓï·¨µÄÀý³Ì£©
4.java se6.0±à³ÌÖ¸ÄÏ£¨ºñʵ ......
¹Ø¼ü×Ö: java³éÏóÀàºÍ½Ó¿ÚµÄÇø±ð---Ïêϸ½â˵
abstract classºÍinterfaceÊÇJavaÓïÑÔÖжÔÓÚ³éÏóÀඨÒå½øÐÐÖ§³ÖµÄÁ½ÖÖ»úÖÆ£¬ÕýÊÇÓÉÓÚÕâÁ½ÖÖ»úÖÆµÄ´æÔÚ£¬²Å¸³ÓèÁËJavaÇ¿´óµÄÃæÏò¶ÔÏóÄÜÁ¦¡£abstract classºÍinterfaceÖ®¼äÔÚ¶ÔÓÚ³éÏóÀඨÒåµÄÖ§³Ö·½Ãæ¾ßÓкܴóµÄÏàËÆÐÔ£¬ÉõÖÁ¿ÉÒÔÏà»¥Ìæ»»£¬Òò´ËºÜ¶à¿ª·¢ÕßÔÚ½øÐгéÏóÀඨÒåʱ¶ÔÓÚ ......