JAVA½Ó¿ÚµÄ¸ÅÄî¼°ÖÖÀà
Ò»¸öJava½Ó¿Ú(Interface)ÊÇһЩ·½·¨ÌØÕ÷µÄ¼¯ºÏ£¬ÕâЩ·½·¨ÌØÕ÷µ±È»À´×ÔÓÚ¾ßÌåµÄ·½·¨£¬µ«ÊÇËüÃÇÒ»°ã¶¼À´×ÔÓÚϵͳÖв»¶Ï³öÏֵķ½·¨¡£Ò»¸ö½Ó¿ÚÖ»Óз½·¨µÄÌØÕ÷£¬¶øûÓз½·¨µÄʵÏÖ£¬Òò´ËÕâЩ·½·¨ÔÚ²»Í¬µÄµØ·½±»ÊµÏÖʱ£¬¿ÉÒÔÓÐÍêÈ«²»Í¬µÄÐÐΪ¡£ÔÚJavaÓïÑԵģ¬Java½Ó¿Ú»¹¿ÉÒÔ¶¨ÒåPublic³£Á¿¡£
1¡¢µ¥·½·¨½Ó¿Ú
public interface ActionListener
{
public abstract void actionPerformed(ActionEvent event);
}
2¡¢±êʶ½Ó¿Ú
±êʶ½Ó¿ÚÊÇûÓÐÈκη½·¨ºÍÊôÐԵĽӿÚ.±êʶ½Ó¿Ú²»¶ÔʵÏÖËüµÄÀàÓÐÈκÎÓïÒåÉϵÄÒªÇó£¬Ëü½ö½ö±íÃ÷ʵÏÖËüµÄÀàÊôÓÚÒ»¸öÌض¨µÄÀàÐÍ¡£
package java.io;
public interface Serializable{};
3¡¢³£Á¿½Ó¿Ú
Ëùν³£Á¿½Ó¿Ú£¬ÊÇÖ¸ÓÃJava½Ó¿ÚÀ´ÉùÃ÷һЩ³£Á¿£¬È»ºóÓÉʵÏÖÕâ¸ö½Ó¿ÚµÄÀàʹÓÃÕâЩ³£Á¿¡£
public interface AppConstants
{
public static final DATA_SOURCE_NAME="test";
public static final USER_NAME="test";
public static final PASSWORD="test";
}
Ïà¹ØÎĵµ£º
ÀàµÄ³õʼ»¯ºÍ¶ÔÏó³õʼ»¯ÊÇ JVM ¹ÜÀíµÄÀàÐÍÉúÃüÖÜÆÚÖзdz£ÖØÒªµÄÁ½¸ö»·½Ú£¬Google ÁËÒ»±éÍøÂ磬ÓйØÀà×°ÔØ»úÖƵÄÎÄÕµ¹ÊDz»ÉÙ£¬È»¶øÀà³õʼ»¯ºÍ¶ÔÏó³õʼ»¯µÄÎÄÕ²¢²»¶à£¬ÌرðÊÇ´Ó×Ö½ÚÂëºÍ JVM ²ã´ÎÀ´·ÖÎöµÄÎÄÕ¸üÊÇÏÊÓÐËù¼û¡£
±¾ÎÄÖ÷Òª¶ÔÀàºÍ¶ÔÏó³õʼ»¯È«¹ý³Ì½øÐзÖÎö£¬Í¨¹ýÒ»¸öʵ¼ÊÎÊÌâÒýÈ룬½«Ô´´úÂëת»»³É JVM ×Ö½ÚÂëºó£¬ ......
ÀûÓÃPowerShell½Å±¾·½±ãJavaѧϰ
ÎÒÊÇÒ»ÃûJava²ËÄñ£¬ÔÚÕâ¸öÈëÃŽ׶ÎÀïÃâ²»ÁËÒª·´¸´µÄʹÓÃjavac xx.javaºÍjava xxÀ´ÔËÐкͲâÊÔ×Ô¼ºµÄ³ÌÐò¡£·³ÁË……£¬µ«Ò²µÃ±ï×Å¡£
½ñÌìÐÄÇé²»ºÃ£¬»»Á˸öWin7£¨»»¸öϵͳ£¬»»¸öÐÄÇ飩¡£µ±ÎÒÒÀ¾É°´ ......
javaģʽ֮µ¥Àýģʽ£º
µ¥Àýģʽȷ±£Ò»¸öÀàÖ»ÓÐÒ»¸öʵÀý£¬×ÔÐÐÌṩÕâ¸öʵÀý²¢ÏòÕû¸öϵͳÌṩÕâ¸öʵÀý¡£
Ìص㣺
1£¬Ò»¸öÀàÖ»ÄÜÓÐÒ»¸öʵÀý
2£¬×Ô¼º´´½¨Õâ¸öʵÀý
& ......
1£©¸ÅÄ
ÊÇÔÚÔËÐÐ״̬ÖУ¬¶ÔÓÚÈÎÒâÒ»¸öÀ࣬¶¼Äܹ»ÖªµÀÕâ¸öÀàµÄËùÓÐÊôÐԺͷ½·¨£»¶ÔÓÚÈÎÒâÒ»¸ö¶ÔÏ󣬶¼Äܹ»µ÷ÓÃËüµÄÈÎÒâÒ»¸ö·½·¨£»ÕâÖÖ¶¯Ì¬»ñÈ¡µÄÐÅÏ¢ÒÔ¼°¶¯Ì¬µ÷ÓöÔÏóµÄ·½·¨µÄ¹¦ÄܳÆΪjavaÓïÑԵķ´Éä»úÖÆ¡£
2£©¹¦ÄÜ£º
ÔÚÔËÐÐʱÅжÏÈÎÒâÒ»¸ö¶ÔÏóËùÊôµÄÀࣻ
ÔÚÔËÐÐʱ ......
ʵ¼ÊÉÏ£¬ÎÒ¹ØÓÚjavaµÄ»ù´¡ÖªÊ¶µÄ90%ÒÔÉ϶¼À´×ÔThinking in Java¡£¶ÔÓÚÆäÖеÄsynchronized¹Ø¼ü×Ö£¬µ±Ê±¾ÍÊÇä¯ÀÀһϣ¬´ó¸ÅÖªµÀÒâ˼£¬Ò²Ã»ÓÐϸ¿´¡£ºóÀ´Ò»Ö±Ã»ÓÐÓùýÕâ¸ö¹Ø¼ü×Ö¡£×òÌì¿´Thinking in Patterns with JavaÖеÄObserverģʽ£¬¿´ÁËÆäÖеÄObservableÀàµÄÔ´Â룬·¢ÏÖÀïÃ漸ºõËùÓеķ½·¨¶¼ÓÃÁËsynchronized¹Ø¼ü×Ö£¨²»ÊÇÈ ......