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
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
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
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program 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
Archived Comments
1. Hi,
Please tell me how to execute the above
View Tutorial By: DurgaPrasad at 2011-11-24 06:04:48
2. sir,i m doing ME/CSE.i want to know more informati
View Tutorial By: m.rajalakshmi at 2011-07-27 05:20:44
3. Thanks Steven, That is an exhaustive list of diffe
View Tutorial By: Robert at 2008-12-08 22:17:47
4. Nice work. Thanks
View Tutorial By: Karthik at 2009-09-30 08:02:36
5. Friends i m getting error while intrepreting the e
View Tutorial By: Hanuman at 2014-02-04 14:14:00
6. sir, i am completed MCA 2011 and i want to learn P
View Tutorial By: vipin kumar at 2011-09-13 13:00:05
7. Thanks for the tutorial.
One questi
View Tutorial By: Stephen at 2012-06-09 06:36:23
8. I want to know that what is the main use of the &q
View Tutorial By: Krunal Patel at 2012-09-17 08:11:19
9. The code to show recursion is ok, but the declara
View Tutorial By: Gaurav at 2010-08-08 01:08:27
10. Good explanation... very helpfull
View Tutorial By: Ananth at 2009-02-02 00:26:05