Comment on Tutorial - Method Overriding in Java By Henry



Comment Added by : georgy

Comment Added at : 2009-10-22 02:46:10

Comment on Tutorial : Method Overriding in Java By Henry
I HAVE ONE DOUBT.

public class Animal {

public static void testClassMethod1() {
System.out.println("The class method in Animal.");
}
public void testInstanceMethod() {
System.out.println("The instance method in Animal.");
}
}


public class Cat extends Animal {
public static void testClassMethod() {
System.out.println("The class method in Cat.");
}
public void testInstanceMethod() {
System.out.println("The instance method in Cat.");
}
}


public static void main(String[] args) {
// TODO code application logic here
Cat myCat = new Cat();
myCat.testClassMethod1();

}
my QUESTION is that can we call "myCat.testClassMethod1()" as OVERRIDING.if yes then why?


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. programming is really exciting specially with c++^
View Tutorial          By: Jully at 2010-07-28 18:42:23

2. nice cursor beside learn java...but i do not know
View Tutorial          By: yazidie_y at 2008-03-08 03:33:03

3. Good one.........!!!
View Tutorial          By: Shailesh Nakade at 2012-07-11 09:48:33

4. but include<iostream> is main function.
View Tutorial          By: glen at 2009-02-03 22:19:22

5. This is an old method although it works. The bette
View Tutorial          By: Emiley at 2013-01-11 03:56:02

6. #include<iostream>
#include<conio.

View Tutorial          By: XavioR at 2011-01-31 00:53:11

7. Good example for vector
View Tutorial          By: mangai at 2011-07-07 09:46:10

8. i have a error while i running this program

View Tutorial          By: parul at 2012-02-08 15:40:09

9. Hi,

I have tried with your script a

View Tutorial          By: Ivan at 2011-09-08 21:17:36

10. can help me for program in java Tomorrow I have ex
View Tutorial          By: blasm at 2013-06-21 06:59:41