Java Interface Êdz£Á¿´æ·ÅµÄ×î¼ÑµØµãÂð£¿
ÓÉÓÚjava interfaceÖÐÉùÃ÷µÄ×Ö¶ÎÔÚ±àÒëʱ»á×Ô¶¯¼ÓÉÏstatic finalµÄÐÞÊηû£¬¼´ÉùÃ÷Ϊ³£Á¿¡£Òò¶øinterfaceͨ³£ÊÇ´æ·Å³£Á¿µÄ×î¼ÑµØµã¡£È»¶øÔÚjavaµÄʵ¼ÊÓ¦ÓÃʱȴ»á²úÉúһЩÎÊÌâ¡£
ÓÉÓÚjava interfaceÖÐÉùÃ÷µÄ×Ö¶ÎÔÚ±àÒëʱ»á×Ô¶¯¼ÓÉÏstatic finalµÄÐÞÊηû£¬¼´ÉùÃ÷Ϊ³£Á¿¡£Òò¶øinterfaceͨ³£ÊÇ´æ·Å³£Á¿µÄ×î¼ÑµØµã¡£È»¶øÔÚjavaµÄʵ¼ÊÓ¦ÓÃʱȴ»á²úÉúһЩÎÊÌâ¡£
ÎÊÌâµÄÆðÒòÓÐÁ½¸ö£¬µÚÒ»£¬ÊÇÎÒÃÇËùʹÓõij£Á¿²¢²»ÊÇÒ»³É²»±äµÄ£¬¶øÊÇÏà¶ÔÓÚ±äÁ¿²»Äܸ³Öµ¸Ä±ä¡£ÀýÈçÎÒÃÇÔÚÒ»¸ö¹¤³Ì³õÆÚ¶¨Òå³£Á¿∏£½3.14£¬¶øÓÉÓÚ¼ÆË㾫¶ÈµÄÌá¸ßÎÒÃÇ¿ÉÄÜ»áÖØж¨Òå∏£½3.14159£¬´ËʱÕû¸öÏîÄ¿¶Ô´Ë³£Á¿µÄÒýÓö¼Ó¦¸Ã×ö³ö¸Ä±ä¡£µÚ¶þ£¬javaÊǶ¯Ì¬ÓïÑÔ¡£Óëc++Ö®ÀàµÄ¾²Ì¬ÓïÑÔ²»Í¬,java¶ÔһЩ×ֶεÄÒýÓÿÉÒÔÔÚÔËÐÐÆÚ¶¯Ì¬½øÐУ¬ÕâÖÖÁé»îÐÔÊÇjavaÕâÑùµÄ¶¯Ì¬ÓïÑÔµÄÒ»´óÓÅÊÆ¡£Ò²¾ÍʹµÃÎÒÃÇÔÚjava¹¤³ÌÖÐÓÐʱ²¿·ÖÄÚÈݵĸı䲻ÓÃÖØбàÒëÕû¸öÏîÄ¿£¬¶øÖ»Ðè±àÒë¸Ä±äµÄ²¿·ÖÖØз¢²¼¾Í¿ÉÒԸıäÕû¸öÓ¦Óá£
½²ÁËÕâô¶à£¬Ä㻹²»ÖªµÀÎÒҪ˵ʲôÂ𣿺ã¬ÎÒÃÇÀ´¿´Ò»¸ö¼òµ¥µÄÀý×Ó£º
ÓÐÒ»¸öinterface A£¬Ò»¸öclass B£¬´úÂëÈçÏ£º
//file A.java
public interface A{
String name = "bright";
}
//file B.java
public class B{
public static void main(String[] args){
System.out.println("Class A's name = " + A.name);
}
}
¹»¼òµ¥°É£¬ºÃ£¬±àÒëA.javaºÍB.java¡£
ÔËÐУ¬ÊäÈëjava B£¬ÏÔÈ»½á¹ûÈçÏ£º
Class A's name = bright
ÎÒÃÇÏÖÔÚÐÞ¸ÄA.javaÈçÏ£º
//file A.java
public interface A{
String name = "bright sea";
}
±àÒëA.javaºóÖØÐÂÔËÐÐB class£¬ÊäÈëjava B£¬×¢Ò⣺½á¹ûÈçÏÂ
Class A's name = bright
Ϊʲô²»ÊÇ"Class A's name = bright sea"£¿ÈÃÎÒÃÇʹÓÃjdkÌṩµÄ·´±àÒ빤¾ßjavap·´±àÒëB.class¿´¸ö¾¿¾¹£¬ÊäÈ룺javap -c B £¬½á¹ûÈçÏ£º
Compiled from B.java
public class B extends java.lang.Object {
public B();
public static void main(java.lang.String[]);
}
Method B()
0 aload_0
1 invokespecial #1 <Method java.lang.Object()>
4 return
Method void main(java.lang.String[])
0 getstatic #2 <Field java.io.PrintStream out>
3 ldc #3 <String "Class A's name = bright">
5 invokevirtual #4 <Method void println(java.lang.String)>
8 return
×¢Òâµ½±êºÅ3µÄ´ú
Ïà¹ØÎĵµ£º
×¼±¸¹¤×÷
Ê×ÏÈ£¬²Ù×÷ϵͳÖа²×°ºÃSQL Server 2000/2005£¬Èç¹ûϵͳÖж¼×°ÓÐ2000ºÍ2005°æ£¬¼ÇµÃÍ£ÓÃÒ»¸ö£¬Ö»¿ªÒ»¸öÐÐÁË¡£
È»ºó£¬µ½Î¢ÈíÍøÕ¾ÏÂÔØMicrosoft SQL Server 2005 JDBC Driver 1.1
£¬Ò²¿ÉÒÔʹÓÃÕâ¸öµØÖ·Ö±½ÓÏÂÔØ
¡£
½âѹsqljdbc_1.1.1501.101_chs.exe£¬°Ñsqljdbc_1.1¸´ÖƵ½%ProgramFiles%£¨Èç¹ûϵͳÔÚCÅÌÔòΪC:\ ......
JavaÐéÄâ»ú²ÎÊý·ÖΪ»ù±¾²ÎÊýºÍÀ©Õ¹²ÎÊý£¬±¾ÎÄÖ÷ÒªÏêϸ½éÉÜ»ù±¾²ÎÊýÖи÷¸ö²ÎÊýµÄÒâÒåÒÔ¼°ÆäÓ÷¨¡£
Òª²é¿´JavaÐéÄâ»úÓÐÄÄЩ¿ÉÑ¡µÄ²ÎÊýÅäÖ㬿ÉÒÔÖ±½ÓÔËÐÐjavaÃüÁÏÔʾÈçÏÂЧ¹û£º
ϱ߷ֱð½éÉÜÿ¸ö²ÎÊýµÄÓ÷¨£º
1. -client£¬-server
ÕâÁ½¸ö²ÎÊýÓÃÓÚÉèÖÃÐéÄâ»úʹÓúÎÖÖÔËÐÐģʽ£¬clientģʽÆô¶¯±È½Ï¿ì£¬µ«ÔËÐÐʱÐÔÄܺÍÄÚ´ ......
ÓÐÈË˵java nioÔÚ¶àÏ̻߳·¾³Ï±à³Ì¼òÖ±¾ÍÊǸö¶ñÃÎ,ÆäʵÄãÈç¹ûÄÜ°ÑÎÕסjava nio APIµÄÒªÁì,Äã¾Í¿ÉÒÔ½«Ö®¼ÝÔ¦.
0. Ò»¸ö channal ¶ÔÓ¦Ò»¸öSelectionKey in the same selector.
e.g:
SelectionKey sk=sc.register(selector, SelectionKey.OP_READ, handler);
sk==sc.register(selector, SelectionKey.OP_WRITE, handl ......
Ò»¡¢ÀûÓÃrandom·½·¨À´Éú³ÉËæ»úÊý¡£
ÔÚJavaÓïÑÔÖÐÉú³ÉËæ »úÊýÏà¶ÔÀ´Ëµ±È½Ï¼òµ¥£¬ÒòΪÓÐÒ»¸öÏֳɵķ½·¨¿ÉÒÔʹÓá£ÔÚMathÀàÖУ¬JavaÓïÑÔÌṩÁËÒ»¸ö½Ð×örandomµÄ·½·¨¡£Í¨¹ýÕâ¸ö·½·¨¿ÉÒÔÈÃϵͳ²úÉúËæ»ú Êý¡£²»¹ýĬÈÏÇé¿öÏ£¬Æä²úÉúµÄËæ»úÊý·¶Î§±È½ÏС£¬Îª´óÓÚµÈÓÚ0µ½Ð¡ÓÚ1µÄdoubleÐÍËæ»úÊý¡£ËäÈ»ÆäËæ»úÊý²úÉúµÄ·¶Î§±È½ÏС£¬²» ......
1£ºÏȶÔһЩ¸ÅÄîµÄÀí½â£º
JDBC£ºJava DataBase Connection
±¾¼¾Ä¿±ê
1¡¢JDBCµÄ·ÖÀà
2¡¢JDBCµÄÖ÷Òª²Ù×÷ÀàºÍ½Ó¿Ú£º
DriverManager¡¢Connection¡¢Statement¡¢PreparedStatement¡¢ResultSet
3¡¢ÈçºÎʹÓÃJDBCÁ¬½ÓMySQLÊý¾Ý¿â
www.mldn.cnÉÏÓÐMYSQLµÄ½Ì³Ì¡£
1¡¢Ê²Ã´ÊÇJDBC£¿
JDBCÊÇJAVAÌṩµÄÒ»¸ö·þÎñ£¬×¨ÃÅÓÃÓÚ·ÃÎÊ ......