锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品区二区三区日本,日韩精品久久久久久久电影99爱,在线资源avhttp://www.aygfsteel.com/Nightmare/category/48732.htmlzh-cnSat, 28 May 2011 05:33:56 GMTSat, 28 May 2011 05:33:56 GMT60絎旇瘯棰樹腑緇忓父閬囧埌鐨勮冨療瀵箂tatic浠g爜鍧楃殑鐞嗚Вhttp://www.aygfsteel.com/Nightmare/articles/351204.html灞呭仴灞呭仴Fri, 27 May 2011 13:12:00 GMThttp://www.aygfsteel.com/Nightmare/articles/351204.htmlhttp://www.aygfsteel.com/Nightmare/comments/351204.htmlhttp://www.aygfsteel.com/Nightmare/articles/351204.html#Feedback0http://www.aygfsteel.com/Nightmare/comments/commentRss/351204.htmlhttp://www.aygfsteel.com/Nightmare/services/trackbacks/351204.html浠g爜1 SonClass.java
 1 /**
 2  * Created by IntelliJ IDEA.
 3  * User: solo
 4  * Date: 11-5-20
 5  * Time: 涓嬪崍7:29
 6  * To change this template use File | Settings | File Templates.
 7  */
 8 public class SonClass extends FatherCLass
 9 {
10     private  String sonName = "son";
11     static
12     {
13         System.out.println("It's the son static field");
14     }
15     public static void main(String[] args)
16     {
17         SonClass sonClass = new SonClass();
18         System.out.println("SonClass has been created");
19     }
20 }
21 class FatherCLass
22 {
23 
24     private String fatherName = getFatherName();
25     static
26     {
27         System.out.println("It's the first father static field");
28     }
29     static
30     {
31         System.out.println("It's the second father static field");
32     }
33     private static  String getFatherName()
34     {
35         System.out.println("initialize the field:fatherName");
36         return "BaBa";
37     }
38     public FatherCLass()
39     {
40         System.out.println("FatherClass has been created");
41     }
42 }
43 
褰撶劧浜嗭紝棰樼洰涓鑸氨鏄姹傚啓鍑虹▼搴忕殑杈撳嚭銆?br />
榪欓噷涓昏娑夊強鍒頒笁涓富瑕佺殑闂錛?br />1.static浠g爜鍧楀垵濮嬪寲鐨勯『搴?br />2.瀛愮被緇ф壙鐖剁被錛屽湪瀹炰緥鍖栨椂瀵圭埗綾繪瀯閫犲嚱鏁扮殑璋冪敤
3.鐖剁被涓璮atherName浠涔堟椂鍊欒鍒濆鍖?br />
鎴戠殑鐞嗚В濡備笅錛?br />1.static浠g爜鍧楃殑鍒濆鍖栨槸鍦ㄧ被緙栬瘧鏈熷畬鎴愮殑錛屽叾鎵ц欏哄簭鎸夌収鍦ㄧ被涓嚭鐜扮殑欏哄簭渚濇鎵ц銆傚洜姝ら鍏堣緭鍑虹殑搴斿綋鏄埗綾諱腑鐨剆tatic鍧楋紝鍏舵鏄瓙綾諱腑鐨剆tatic鍧?br />2.瀛愮被鍦ㄥ疄渚嬪寲鏃訛紝浼氳皟鐢ㄧ埗綾繪瀯閫犲嚱鏁幫紝鍥犳鐖剁被鏋勯犲嚱鏁頒腑鐨刼ut涓鍙ヤ細琚墽琛?br />3.鍦ㄥ垵濮嬪寲鏃訛紝鍙橀噺鍏堜簬鏋勯犲嚱鏁?br />鍥犳錛岀患涓婏紝鏁翠釜紼嬪簭鐨勮緭鍑烘搴忓簲褰撴槸錛?br />鐖剁被static鍧?-->瀛愮被static鍧?-->鐖剁被鍙橀噺--->鐖剁被鏋勯犲嚱鏁?-->瀛愮被鏋勯犲嚱鏁?br />
瀹為檯杈撳嚭緇撴灉濡備笅錛?br />
It's the first father static field
It's the second father static field
It's the son static field
initialize the field:fatherName
FatherClass has been created
SonClass has been created

ps錛氳嫢鏂囦腑鏈変粈涔堥敊璇紝嬈㈣繋鎵硅瘎鎸囨銆?img src ="http://www.aygfsteel.com/Nightmare/aggbug/351204.html" width = "1" height = "1" />

灞呭仴 2011-05-27 21:12 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 吴川市| 靖边县| 那坡县| 固原市| 田林县| 临城县| 岳阳市| 东城区| 汕头市| 永春县| 施秉县| 扎囊县| 宁晋县| 翼城县| 郎溪县| 桂阳县| 沈丘县| 渑池县| 福建省| 漳州市| 朝阳县| 巴里| 汾西县| 丽水市| 石楼县| 靖边县| 汕头市| 黄浦区| 台中县| 布拖县| 三门县| 怀柔区| 南澳县| 稷山县| 定安县| 东丽区| 桐乡市| 广丰县| 江川县| 和田市| 阿拉尔市|