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. I am not able to open the rar file, can you please
View Tutorial          By: Chandra at 2008-08-07 10:35:59

2. works like a charm, though i didn't understand why
View Tutorial          By: primus at 2010-05-19 04:46:18

3. Hi , it was nice tutorial to understand the differ
View Tutorial          By: jagan at 2014-06-05 05:13:59

4. pls send to me example about stacks
becaus

View Tutorial          By: suliman at 2011-12-10 08:02:01

5. I am running it within NetBeans. I set a breakpoin
View Tutorial          By: PeteC at 2014-02-22 18:57:14

6. really really very good
thanks all
a

View Tutorial          By: bade3 at 2010-01-01 18:52:15

7. can you give me tutorial how to copy phonebook to
View Tutorial          By: rico at 2010-04-04 21:07:57

8. how to append data to existing excel sheets withou
View Tutorial          By: nim at 2011-03-23 00:28:10

9. Hi Ashley, thank you for this Android Gridview tut
View Tutorial          By: Giancarlo Leonio at 2013-03-12 00:37:15

10. You said the garbage collector can not be forced,
View Tutorial          By: Biniam E at 2011-12-17 15:09:09