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. How do use qsort to sort lines in text file?
View Tutorial          By: kenny at 2008-11-18 08:59:55

2. The logo is a cup of coffee. Java is an island in
View Tutorial          By: kamal goduguluri at 2012-05-30 15:34:21

3. i want to know how to connect one page to another
View Tutorial          By: mahesh at 2009-08-26 01:31:40

4. The code gives the following exception :-
<

View Tutorial          By: waqar at 2012-07-26 17:02:07

5. What is the \ in several of the string building st
View Tutorial          By: rogerb at 2012-01-28 23:07:31

6. this is really very useful because of this site i
View Tutorial          By: meenakshi shukla at 2012-09-15 05:09:49

7. thanks , but i want it some thing like fibonici se
View Tutorial          By: Arpit Agrawal at 2015-01-04 18:34:41

8. how to execute all the 5 files plz tell me step by
View Tutorial          By: asraf at 2007-11-14 22:29:20

9. Before i had lot of doubts in abstract class... no
View Tutorial          By: Mohandoss at 2012-04-02 05:08:43

10. Thank you for this tutorial. Thank you all the mor
View Tutorial          By: sd at 2013-09-09 05:38:52