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



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. Yeah, great article
View Tutorial          By: smeagol_s at 2009-03-29 02:45:01

3. Awesome article. It's very useful. Despite it didn
View Tutorial          By: Matheus at 2015-02-24 12:06:05

4. Thanks this tutorial helped me :)
View Tutorial          By: Anuja at 2012-07-17 06:59:39

5. Ku is quite correct. When you create any object, i
View Tutorial          By: Avnish at 2010-10-28 04:00:20

6. Very good explanation . I was very confuse but rea
View Tutorial          By: Shahabaj at 2010-08-10 08:58:39

7. thnks lot 4 helping me
View Tutorial          By: sandeep dudi at 2011-11-17 06:06:03

8. Very nice article.. thanks
View Tutorial          By: Basu at 2010-05-29 05:52:00

9. Nice example. Thank you very much.
View Tutorial          By: vinod at 2012-06-19 11:19:53

10. Great ! done a gud job
View Tutorial          By: Manju at 2012-11-02 06:43:58