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. how this program is work , please, tell
View Tutorial          By: rohit kumar at 2015-10-30 12:22:05

2. hay is there any way to perform operation or calcu
View Tutorial          By: neha at 2009-11-20 08:29:45

3. good info to create package
View Tutorial          By: Nirdesh at 2012-10-01 03:45:02

4. really nice and perfect ! thnak you very much for
View Tutorial          By: arash at 2013-07-16 10:58:45

5. good example
View Tutorial          By: WANT TO KNOW WHY WE USE APPEND at 2011-06-14 00:39:48

6. Thanks.I was searching the internet for a lot of t
View Tutorial          By: Habi at 2011-12-22 07:43:51

7. would like to have copy of clock
View Tutorial          By: jim johnson at 2008-04-10 17:30:06

8. yes it is very gud but i have still a doubt that i
View Tutorial          By: Akheel at 2010-10-10 09:41:13

9. This program is faulty .

Check for

View Tutorial          By: Shrikant Kale at 2014-09-09 07:31:04

10. thank you sir
View Tutorial          By: sivaranjani at 2015-01-30 01:15:40