javaÖй¹Ô캯ÊýµÄµ÷ÓÃ˳Ðò
µ±Ò»¸ö¸´ÔӵĶÔÏó±»¹¹Ôìʱ,ËüµÄ¹¹Ô캯Êý°´ÏÂÃæµÄ˳Ðò±»µ÷ÓÃ(that the order of constructor calls for a complex object is as follows)
1.Æä»ùÀà(base-class)µÄ¹¹Ô캯Êý±»µ÷ÓÃ,Õâ¸ö²½ÖèÒԵݹéµÄ·½Ê½Öظ´,ËùÒÔ×îµ×²ã(the root of hierarchy)µÄ¹¹Ô캯ÊýÊ×Ïȱ»Ö´ÐÐ,È»ºóÊÇËüÉÏÒ»²ãÅÉÉúÀà(the next-derived class)...Ö±µ½×î¶¥²ãµÄÅÉÉúÀà(the most-derived class).
The base-class constructor is called. This step is repeated recursively such that the root of the hierarchy is constructed first, followed by the next-derived class, etc., until the most-derived class is reached.)
2.Èç¹ûÓаüº¬¹ØÏµ(composition),ÄÇôËüµÄ³ÉÔ±¶ÔÏó°´ÕÕÉùÃ÷µÄ˳Ðò±»¹¹Ôì.
Member initializers are called in the order of declaration.
3.ÅÉÉúÀ๹Ô캯ÊýµÄÄÚÈÝ(body)±»Ö´ÐÐ.
The body of the derived-class constructor is called.
Ò»¸öʵÀý:
class Cake{
Cake(){System.out.println("Cake()");}
}
class Meal {
Meal() { System.out.println("Meal()"); }
}
class Bread {
Bread() { System.out.println("Bread()"); }
}
class Cheese {
Cheese() { System.out.println("Cheese()"); }
}
class Lettuce {
Lettuce() { System.out.println("Lettuce()"); }
}
class Lunch extends Meal {
Lunch() { System.out.println("Lunch()"); }
}
class PortableLunch extends Lunch {
//if make derived-class object as the menber of the base-class will lead a infinite
//loop and program will stop because of the memory consumed
//private Sandwich s=new Sandwich();
private Cake a=new Cake();
PortableLunch() {&n
Ïà¹ØÎĵµ£º
1£®toString£¨£©·½·¨
ObjectÀà¾ßÓÐÒ»¸ötoString()·½·¨£¬Äã´´½¨µÄÿ¸öÀà¶¼»á¼Ì³Ð¸Ã·½·¨¡£Ëü·µ»Ø¶ÔÏóµÄÒ»¸öString±íʾ£¬²¢ÇÒ¶ÔÓÚµ÷ÊԷdz£ÓаïÖú¡£È»¶ø¶ÔÓÚĬÈϵÄtoString()·½·¨ÍùÍù²»ÄÜÂú×ãÐèÇó£¬ÐèÒª¸²¸ÇÕâ¸ö·½·¨¡£
toString£¨£©·½·¨½«¶ÔÏóת»»Îª×Ö·û´®¡£¿´ÒÔÏ´úÂ룺
package sample;
class Villain {
&nb ......
ÔÚʹÓà Java™ ÓïÑԵķºÐÍʱ£¬Í¨Åä·û·Ç³£ÁîÈËÀ§»ó£¬²¢ÇÒ×î³£¼ûµÄÒ»¸ö´íÎó¾ÍÊÇÔÚʹÓÃÓнçͨÅä·ûµÄÁ½ÖÖÐÎʽµÄÆäÖÐÖ®Ò»£¨“? super T” ºÍ “? extends T”£©Ê±³öÏÖ´íÎó¡£Äú³ö´íÁËÂ𣿱ð¾ÚÉ¥£¬¼´Ê¹ÊÇר¼ÒÒ²»á·¸ÕâÖÖ´íÎ󣬱¾Ô Brian Goetz ½«Õ¹Ê¾ÈçºÎ±ÜÃâÕâ¸ö´íÎó¡£
ÔÚ Java ÓïÑÔÖУ¬Êý×éÊÇбäµÄ£¨ ......
jnlp£¨JavaÍøÂç¼ÓÔØÐÒ飩ÔÀ´ºÜ¼òµ¥
Java Network Launching Protocol (JNLP£¬javaÍøÂç¼ÓÔØÐÒé)¡£
jnlpÊÇʲô£¿ÊÇjavaÌṩµÄÒ»ÖÖÈÃÄã¿ÉÒÔͨ¹ýä¯ÀÀÆ÷Ö±½ÓÖ´ÐÐjavaÓ¦ÓóÌÐòµÄ;¾¶£¬ËüʹÄã¿ÉÒÔÖ±½Óͨ¹ýÒ»¸öÍøÒ³ÉϵÄurlÁ¬½Ó´ò¿ªÒ»¸öjavaÓ¦ÓóÌÐò£®ºÃ´¦¾Í²»ÓÃ˵ÁË£¬Èç¹ûÄãµÄjavaÓ¦ÓóÌÐòÒÔjnlp µÄ·½Ê½·¢²¼£¬Èç¹û°æ±¾Éý¼¶ºó ......
·´Éä»úÖÆ
ÌØµã£º¶¯Ì¬»ñÈ¡ÀàÒÔ¼°ÀàÖгÉÔ±¡£
ͨ³£ÔÚ³ÌÐòÀ©Õ¹Ê±£¬»áʹÓø¸Àà»òÕß½Ó¿ÚÍê³É£¬Æäʵ¾ÍÊǶà̬¡£
ÔÚÕâÖÖÇé¿ö£¬ÔËÐÐʱ£¬»¹ÊÇÐèÒª¸øÆä´«µÝÒ»¸ö×Ô¶¨ÒåµÄ×ÓÀà¶ÔÏó¡£ÐèÒª×Ô¼ºnewÀ´Íê³É¡£
ËäÈ»Ð޸͝×÷ÒѾºÜÉÙÁË£¬µ«»¹ÊÇÐèÒªÐ޸IJ¿·Öϸ½Ú¡£
interface Inter{void show();}
class Demo{
  ......
µÚÒ»£ºÒªÉèÖÃSQL ServerµÄTCP/IP·þÎñ
1) ´ò¿ªSQL Server Configuration Manager”,Ë«»÷“SQL Server 2005ÍøÂçÅäÖÔ£¬µã»÷“*** µÄÐÒé” (×¢Ò⣺***´ú±íʵÀýÃüÃû£¬ÀýÈ磺accpDBµÄÐÒé)
2) Ñ¡ÔñÓұߴ°¿ÚÖеēTCP/IP”ÐÒ飬ÓÒ¼üµ ......