July 27, 2011

Use of super keyword in Java

  1. Super keyword can be used to access the super class constructor from the subclass constructor.
  2. Super must be the first function in the subclass constructor.
  3. It is the first function to be executed in the subclass constructor.
  4. Super function will access the super class constructor according to the matching arguments.
  5. It can also be used to access the members of the Super class.
  6. When method overriding is done,then super can be used to access the overrided method of super class from subclass.

No comments:

Post a Comment

Connecting Java program to Database

It is very simple to establish a connection to the Database from a Java program          Class.forName("com.mysql.jdbc.Driver...