View RSS Feed

Java Object

What Is Inheritance?

Rate this Entry
by , 04-26-2012 at 06:28 PM (1070 Views)
Various objects consist of certain common amount with each other. Tandem bikes, mountain bikes and road bikes etc share the common bicycle characteristics (current gear, current speed, and current pedal cadence). Yet, additional features are defined byeach which will make them a bit different: Road cycles consist of handlebars; tandem bicycles consist of 2 handlebar sets & 2 seats; mountain bikes have an extra chain ring that provides low gear ratio to them.

Object oriented programming inherits the commonly used behavior and state from various other classes. Now, Bicycle has become, in this example, the superclass of TandemBike, RoadBike and MountainBike. Every class in Java programming language consists of one superclass which holds potential of unlimited subclasses:

Name:  1.jpg
Views: 226
Size:  13.5 KB

Submit "What Is Inheritance?" to Facebook Submit "What Is Inheritance?" to Digg Submit "What Is Inheritance?" to Submit "What Is Inheritance?" to StumbleUpon Submit "What Is Inheritance?" to Google