首页 > 应用开发 > Java > 浅谈 Java 中 this 的使用(转)
|
CODE:
public class A {
String s = "Hello"; public A(String s) { System.out.println("s = " + s); System.out.println("1 -> this.s = " + this.s); this.s = s; System.out.println("2 -> this.s = " + this.s); } public static void main(String[] args) { new A("HelloWorld!"); } } 来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10617542/viewspace-960353/ ,如需转载,请注明出处,否则将追究法律责任。
上一篇:
编写跨平台Java程序注意事项(转)
请登录后发表评论
登录
全部评论
|