???Java??staitc?????
???????????? ???????[ 2014/11/13 13:44:41 ] ????????Java ???? ????? ??????畏?
???????static????
????static???????畏?????????芯?????畏?????????????????????魏伪???????????????????????????????????娲�???????谓????????????????????????????????????????????????????????????????????校???????????????????????????????????
??????Java???????妫�????????????????????????????????????????????????????????????????卤??????????????????????????貌??????????些??????????????????????贸??????static???????
????static???????????????????????????????
1 class Demo{
2 public static void main(String[] args)
3 {
4 Person p = new Person();
5 System.out.println(p.country); //1????????????
6 System.out.println(Person.country); //2???????????????
7 }
8 }
9 class Person{
10 static String country = "china";
11 }
????????static???
???????????贸?static?????
????a??static????????畏??????????纬????
????b??static???蔚????????械???????
????c??static?????????????static?????????????????????
????d??static???纬?????????梅??--??????????谩?
???????????????????????????
????1.???????????????????
????????????????????????????????????
?????????????????????????????????????????
????2?????梅??
?????????????????????谩?
????????????????????????????????????谩?
????3??????写娲⑽�?貌????
????????????娲�???????小?
????????????娲�?????????????????????????????
????????????????????
????1??????????????????????
????2??????????胁???????this??super???????
????3?????????????????
class Demo{
public static void main(String[] args)
{
Person.show();
}
}
class Person{
static String country = "china";
String name = "jinfulin";
public static void show()
{
System.out.print(country); //???
//System.out.print(name); //????
}
}
??????

???路???
??????????????????
2023/3/23 14:23:39???写?貌??????????
2023/3/22 16:17:39????????????????????些??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???路???????路
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11