Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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();  
}}
Source by sites.google.com #
 
PREVIOUS NEXT
Tagged: #Example #invoke #current #class #method
ADD COMMENT
Topic
Name
9+9 =