Re: [問題]請問JAVA static及non-static的問題

看板Programming作者時間18年前 (2007/11/21 21:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《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
文章代碼(AID): #17H2mE00 (Programming)
文章代碼(AID): #17H2mE00 (Programming)