看板Programming
标 题Re: [问题]请问JAVA static及non-static的问题
发信站SayYA 资讯站 (Wed Nov 21 20:36:18 2007)
转信站ptt!ctu-reader!ctu-peer!news.nctu!News.Math.NCTU!SayYa
※ 引述《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