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. I want to use concept of overriding and i want to
View Tutorial          By: Aniket at 2013-06-20 10:23:10

2. it is good site , and i have cleared my doubts
View Tutorial          By: imtiaz at 2009-10-15 23:43:50

3. You know what will be usefull if we can use this
View Tutorial          By: mechkid at 2012-12-03 14:54:41

4. Good one
View Tutorial          By: Ravi at 2007-11-19 03:30:40

5. "I get an error returned saying the SMPT serv
View Tutorial          By: Dennis at 2011-06-24 10:18:10

6. thanks excellent explanation!!!!!!!!
View Tutorial          By: divya at 2012-01-01 17:37:32

7. hello
thanks for your code. Please could an

View Tutorial          By: Bruno at 2009-05-28 15:38:46

8. Why can't you just use an array for something like
View Tutorial          By: Andrea at 2012-10-18 00:17:48

9. its superb
View Tutorial          By: chotu jain at 2011-05-24 08:47:22

10. What is the use of "SMSConnector" in thi
View Tutorial          By: Mudra at 2010-06-04 15:04:55