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. Awsome...Example...
View Tutorial          By: sitakanta at 2011-12-05 12:22:03

2. How to connect Oracle java cloud service database(
View Tutorial          By: prakash at 2015-08-27 16:19:04

3. if the number is for exemple 00025478 it return a
View Tutorial          By: ahmed at 2015-02-11 12:02:45

4. Sir. Please give an example which is small and und
View Tutorial          By: Rafik at 2011-08-17 19:45:04

5. Error loading win32com: java.lang.UnsatisfiedLinkE
View Tutorial          By: Dinesh557 at 2008-09-23 04:18:47

6. Hi

I want the java code for i

View Tutorial          By: Deepak at 2015-07-29 15:07:09

7. pretty good explanation
View Tutorial          By: Prithwi at 2009-11-26 07:28:33

8. exellent, thks!!!
View Tutorial          By: Eduardo at 2010-01-29 19:20:15

9. It's good working very well...............
View Tutorial          By: avinash at 2013-03-07 09:38:21

10. Splendid! Haven\'t used asserts before, very helpf
View Tutorial          By: Anonymous at 2009-03-11 04:18:42