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. short notes to struts,but i expect more explanatio
View Tutorial          By: jayashri at 2011-11-23 18:24:07

2. Hi this is very clear and helpful, I would like to
View Tutorial          By: JoelC at 2012-11-06 16:23:19

3. lots of thanks for this given example........hope
View Tutorial          By: virgi crisostomo at 2010-08-18 17:18:08

4. It can be Made Popular by adding Links or Suggesti
View Tutorial          By: Ramalingam at 2010-03-20 23:00:41

5. Thanks,It worked.I tried with Microsoft Visual C++
View Tutorial          By: gaurav at 2013-12-04 08:27:35

6. I discover unlimited calendar.this calendar use of
View Tutorial          By: Lalit Kumbhani at 2011-12-31 16:02:06

7. What happens if applied to an integer array?
View Tutorial          By: SHUVO at 2015-07-01 21:14:16

8. Explanation is very good. Thanks all.
View Tutorial          By: reddy at 2010-04-07 08:47:09

9. I have compiled by keeping all the points in mind
View Tutorial          By: Sweety at 2011-03-09 22:29:18

10. download jdk
View Tutorial          By: alireza esfandyarinezhad at 2011-03-07 11:52:55