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. useful for me
View Tutorial          By: ganga at 2010-10-06 00:51:51

2. nice one ...
View Tutorial          By: vamsi at 2011-11-11 06:41:25

3. thanks to this site which get me understand about
View Tutorial          By: Sayak at 2012-10-08 15:57:25

4. There is possible to include 2 conditions in for l
View Tutorial          By: aarthi at 2012-12-10 12:08:50

5. thank's
View Tutorial          By: gerald at 2010-08-06 01:21:39

6. Thanks...

Rohit
xpode.com

View Tutorial          By: Rohit at 2012-04-30 04:18:12

7. good one
View Tutorial          By: thyagesh at 2011-12-06 05:06:27

8. i want source code of Send SMS on Mobile by Net.
View Tutorial          By: Ankit Patel at 2011-07-05 08:43:14

9. Just read the first page, It really attractive. Le
View Tutorial          By: Md. Sumon Bappi at 2015-05-13 10:47:00

10. thank you...
View Tutorial          By: Rojan at 2011-07-04 01:51:45