This link has been bookmarked by 19 people . It was first bookmarked on 02 Mar 2006, by Kalyani.
-
24 May 10
-
07 Apr 10
-
09 Nov 09
-
07 May 09
Lee-Anne Patterson(The Java™ Tutorials > Learning the Java Language > Object-Oriented Programming Concepts)
-
11 Jan 09
-
In the Java programming language, each class is allowed to have one direct superclass, and each superclass has the potential for an unlimited number of subclasses:
-
-
09 May 08
-
07 Oct 07
-
allows classes to inherit commonly used state and behavior from other classes.
-
In this example,
Bicyclenow becomes the superclass -
In the Java programming language, each class is allowed to have one direct superclass, and each superclass has the potential for an unlimited number of subclasses:
-
In the Java programming language, each class is allowed to have one direct superclass, and each superclass has the potential for an unlimited number of subclasses:
-
use the
extendskeyword -
followed by the name of the class to inherit from
-
The syntax for creating a subclass is simple. At the beginning of your class declaration, use the
extendskeyword, followed by the name of the class to inherit from:class MountainBike extends Bicycle { // new fields and methods defining a mountain bike would go here } -
class MountainBike extends Bicycle {
-
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.