Answers for "Example of "this" : to invoke current class method"

0

Example of "this" : to invoke current class method

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();  
}}
Posted by: Guest on August-31-2021

Code answers related to "Example of "this" : to invoke current class method"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language