Thursday, November 24, 2011

Learn Java programming tutorial lesson 8 - Inheritance

What is inheritance?

Inheritance is the ability of objects in java to inherit properties and methods from other objects. When an object inherits from another object it can add its own properties and methods. The object that is being inherited from is called the parent or base class and the class that is inheriting from the parent is called the child or derived class.

How to use inheritance

We will first create a parent class called Person. We will then create a child class called Student. Then we will create a program to use the Student class. The following is a Person class which has a variable...

0 comments:

Post a Comment

Setec Institute || Group : SH6 | | Name : Kim Chanthy. Powered by Blogger.

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Hot Sonakshi Sinha, Car Price in India