Comment on Tutorial - Inheritance Example in Java By Watson



Comment Added by : leela

Comment Added at : 2011-09-08 12:16:24

Comment on Tutorial : Inheritance Example in Java By Watson
I executed this program with the help of below code

public class inheritanceBicycle {

public static void main(String args[]) {

//create the objects of Bicycle & mountainBike
Bicycle B = new Bicycle(10,20,30);
mountainBike m = new mountainBike(1,2,300,4);
// for Bicycle
System.out.println("value of speed of bicycle " + B.speed);
B.speedUp(7);
System.out.println("value of speed after increase " + B.speed);
System.out.println("value of speed of mountainbike " + m.speed);
m.speedUp(7);
System.out.println("value of speed after increase " + m.speed);

}

}


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. thank you...as a beginner this info very useful fo
View Tutorial          By: snigdha at 2012-10-17 11:41:39

2. hai, i tried the abvoe code, m getting the follwin
View Tutorial          By: charan at 2011-10-20 12:59:59

3. I do my projest in j2me.so please send me your ide
View Tutorial          By: sivasakthivel.s at 2011-06-22 13:26:54

4. nice one.. i lik dis page... very informative for
View Tutorial          By: lokesh at 2013-01-10 09:06:22

5. hi ..

for second code which impleme

View Tutorial          By: Eng at 2009-02-21 03:53:29

6. Very nice to understand the concept.It also help t
View Tutorial          By: Hrusikesh jena at 2011-05-26 00:23:28

7. thanks nice article , but there is bug as already
View Tutorial          By: YZ at 2011-08-05 13:10:49

8. really a gud work for xml parsing readers
View Tutorial          By: shreya at 2010-07-02 02:35:04

9. Great details you provided here, very straight for
View Tutorial          By: Jackie Wong at 2010-02-05 10:52:25

10. Awesome .
Helpfull!!

View Tutorial          By: ARMLAB-NG at 2009-06-06 09:22:00