Java

Java - Super Key concept

Java - Super Key concept
// super keyword demonstration 

class one 
{ 
String x = "Velan"; 
} 

class two extends one 
{ 
String x = "Senthil"; 

void display() 
{ 
System.out.println("\n"+x); 
System.out.println("\n"+super.x); 
} 
} 

class ssvSuper 
{ 
public static void main(String arg[]) 
{ 
two t = new two(); 
t.display(); 
} 
}
Senthilvelan Sambamoorthy

Senthilvelan Sambamoorthy is working as a Professor in Department of Master of Computer Applications, Paavai Engineering College, Namakkal, Tamilnadu, India, He is Masters in Computers Applications. Having 18+ years of experience and his area of interest is Java, JSP, Servlet, J2EE, C#, PHP, Python ASP.NET, SQL Server and etc.