我不知道我哪里錯了 我跑完了兩個數(shù)都是84
package fdsa;
//外部類HelloWorld
public class HelloWorld {
private static int score = 84 ;
public static class SInner{
int socre = 91;
public void show(){
System.out.println("訪問外部類中的scoer:" + HelloWorld.score);
System.out.println("訪問內(nèi)部類中的scoer:" + score);
}
}
public static void main(String[] args) {
SInner a = new SInner ();
a.show();
}
}
2016-10-12
第二行與第四行變量名字不一樣
2016-10-12
應(yīng)該把int sorce=91寫到方法里面吧
2016-10-12
你在逗我 么 ? 變量名稱都不一樣 ?。
2016-10-12
把第一個score的static去掉看看
2016-10-12
第六行socre是什么鬼,score才對吧,你改了就可以顯示91了。