static關鍵字

static關鍵字 static變量–類屬性(靜態屬性) static屬性稱爲類屬性,保存在全局數據區中(方法區:所有對象共享區域) 通過類名調用,與對象實例化無關 默認值爲NULL 描述共享屬性使用static屬性 public static class Person{ static String Country = "中華民國"; String name;
相關文章
相關標籤/搜索