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. i Want the Flow Chart for the Calendar Demo Progra
View Tutorial          By: Narayanan V at 2010-01-06 18:57:25

2. Hi,

Just wonder if there is a way t

View Tutorial          By: Bank at 2007-12-18 04:30:26

3. Thank u very much, your topic is very clear, to th
View Tutorial          By: Ahmed Samir at 2011-05-26 23:35:22

4. When run this code then I am getting a blank page.
View Tutorial          By: Paritosh Chandra Dey at 2013-08-14 08:55:42

5. Good one. Clear basic concept
View Tutorial          By: Joshua at 2010-03-12 01:13:08

6. realy i enjoy it for visit your site. and i unders
View Tutorial          By: vinod balot at 2015-02-09 17:43:30

7. sir plz give ur sugissions for my golden future in
View Tutorial          By: sridevi at 2012-06-06 10:26:36

8. Nice article..
View Tutorial          By: senthil at 2009-09-09 00:22:40

9. [English]
Good morning ... the question ari

View Tutorial          By: Federico at 2012-06-01 13:55:13

10. i want simple program of function used in recursio
View Tutorial          By: manish at 2009-05-19 01:03:19