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



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. Very usefull tutorial, but I've got a question:
View Tutorial          By: Wolfgang Marcos at 2011-05-16 11:12:19

2. The above codes is working for me~
yeah, wh

View Tutorial          By: rejectee at 2009-10-23 22:14:25

3. Thanks for the Information. Its very useful
View Tutorial          By: Husain at 2009-03-04 13:30:38

4. Sorry, please disregard my previous comment... Tha
View Tutorial          By: choco at 2010-01-03 02:21:09

5. About the javax.comm.* error, you need to include
View Tutorial          By: Nicolas Tourne at 2011-12-18 15:11:05

6. hi can u send me the complete working code for sen
View Tutorial          By: gautami at 2007-12-04 01:13:45

7. This site providing excellent knowledge about stru
View Tutorial          By: Bellamkonda at 2009-11-12 02:37:44

8. Hi I would like to get help with a client-server d
View Tutorial          By: lolaFireBird at 2012-06-29 08:04:31

9. I und. you guy's are using programming language to
View Tutorial          By: Ken at 2011-07-25 07:10:41

10. answers to the questions asked by ranjan in commen
View Tutorial          By: A Sadist at 2012-07-05 12:13:45