📜  “this”示例:调用当前类方法 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:16.046000             🧑  作者: Mango

代码示例1
class A{  
void m(){System.out.println("hello m");}  
void n(){  
System.out.println("hello n");  
//m();//same as this.m()  
this.m();  // By default added by the compiler
}  
}  
class TestThis4{  
public static void main(String args[]){  
A a=new A();  
a.n();  
}}