Re: [問題]請問JAVA static及non-static的問題
※ 引述《imscorpio (Life is simple!!!)》之銘言:
> 但是non-static不是可以直接存取static嗎???
> public class Hello {
> void mymethod (int a)
> {
> System.out.println(a);
> System.out.println(this.a);
> System.out.println(e); //為什麼這裡不能用e
[--------------------]
您的 scope 沒學好, e 只存在於 main 中 new Hello() 至 } 結束
> {
> int b=9;
> System.out.println(b);
> System.out.println(this.b);
> }
> System.out.println(b);
> }
> }
--
我所追求的純粹只是任性,完全的任性。 -- 挪威的森林
--
※ Origin: SayYA 資訊站 <bbs.sayya.org>
◆ From: 218-167-103-199.dynamic.hinet.net
討論串 (同標題文章)
Programming 近期熱門文章
PTT數位生活區 即時熱門文章