July 27, 2011

My understanding of Inheritance in Java

  1. A class can be inherited by using the keyword extends.
  2. The class which is inherited is called Super class or Parent class.The class which does the inheritance is called Subclass.
  3.  The private members of the super class are cannot be accessed by the sub class.

2 comments:

  1. Is there any other possibilities for accessing private variables in subclass???

    ReplyDelete
  2. There is no other possibility to access the Private members of a class.

    ReplyDelete

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...