Comment on Tutorial - Method Overriding in Java By Henry



Comment Added by : georgy

Comment Added at : 2009-10-22 03:13:01

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



Ask a Question

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. Please tell me how to display the contents of stac
View Tutorial          By: Senthil at 2014-05-21 21:44:05

2. public void playSound(String filename) {

View Tutorial          By: Rowan at 2014-07-17 10:26:02

3. This is just Great, didn't find anything like this
View Tutorial          By: Vikrant Verma at 2012-10-07 04:54:42

4. iam getting intrest to watch this site
View Tutorial          By: monika at 2013-02-15 15:48:57

5. Helps very much. Thank you.
View Tutorial          By: Uwe at 2010-08-17 12:35:44

6. what is the use of int getch(void)
and unge

View Tutorial          By: sania at 2014-06-04 17:15:30

7. i wish to get some example java programs to unders
View Tutorial          By: rebecca at 2010-01-09 03:14:42

8. me too got the same problem....
but m sure

View Tutorial          By: HEHE at 2008-11-19 01:49:04

9. Thanks i had problem with this util module.
View Tutorial          By: james thompson at 2013-09-08 22:25:50

10. Wow! Thank you!
View Tutorial          By: David at 2013-04-24 15:52:45