Aptitude (12) ASP.NET (2) Automata (4) Browser (1) C (5) C# (1) C++ (10) Code (3) CSS (1) Data Structure (1) DATABASE (3) HTML (1) java (43) JSP (1) math (1) MySql (8) other (6) php (3) Servlet (3)

Tuesday, 5 March 2013

constructor



class One
{
  One()
{
   System.out.println("One");
}
}
class Two extends One
{
   Two()
{
   System.out.println("Two");
}
}
class Super2
{
   public static void main(String args[])
{
   Two t=new Two();
}
}




The first  line of every constructor is 
super();
that is every constructor call its super class constructor  first;






No comments:

Post a Comment