package com.two;public class Eight {?? ?public void show(){?? ??? ?final int a =1;?? ??? ??? ??? ?int b =2;?? ??? ?class Ljh{?? ??? ?int c =3;?? ??? ?public void print(){?? ??? ??? ?System.out.println("訪問外部a:"+a);?? ??? ??? ?System.out.println("訪問內(nèi)部c:"+c);?? ??? ??? ?System.out.println("訪問外部b:"+b);?? ??? ??? ??? ??? ?}?? ??? ?}?? ??? ?Ljh i = new Ljh();?? ??? ?i.print();?? ?}?? ?public static void main(String[] args) {?? ??? ?Eight E = new Eight();?? ??? ?E.show();?? ?}}
求問怎么訪問外部變量b,這個(gè)代碼其他都可以執(zhí)行,就是沒辦法訪問外部變量b
慕萊塢1282154
2017-08-20 13:10:05