Java???????Щ???
???????????? ???????[ 2015/12/7 11:20:05 ] ??????????????? ???????????
?????????????Java??С???????????????????????????????д?????????~
????????????????????????????????????????????????????????
????????????? ????????????????????????????????? ??
????1.????????
????????????????????????????????λ?????????????????????????????
????class Outter {
????private int age = 12;
????class Inner {
????private int age = 13;
????public void print() {
????int age = 14;
????System.out.println("?????????" + age);
????System.out.println("??????????" + this.age);
????System.out.println("?????????" + Outter.this.age);
????}
????}
????}
????public class test1 {
????public static void main(String[] args) {
????Outter out = new Outter();
????Outter.Inner in = out.new Inner();
????in.print();
????}
????}
???????н????
?????????????14
??????????????13
?????????????12
??????????????????????????????????????????????????????????г??????????????private????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????class Outter {
????private int age = 12;
????public Outter(int age) {
????this.age = age;
????getInInstance().print(); //?????????????????????????з???!
????}
????private Inner getInInstance() {
????return new Inner();
????}
????class Inner {
????public void print() {
????System.out.println("?????????????????????????????????" + age);
????}
????}
????}
????public class test1 {
????public static void main(String[] args) {
????Outter out = new Outter(10);
????}
????}
???????н????
?????????????????????????????????????10
???????????????private????????protected????????public??????????????????
?????????????????????????????Inner??private???Σ??????????????????????????public???Σ????κε???????????????protected???Σ??????????????????????????????·?????????????????????????????????·????
????????????????????????????????public?????????????????Ρ?
??????????????????????????????????????????????????????????????????????ж?????????Ρ??????????????????????static???????????????????????????????????????????????????
??????
???·???
??????????????????
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