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. hi I am getting error while running this program a
View Tutorial          By: sampada at 2012-04-18 07:45:19

2. What about GraphicsDemo (class...?) mentioned in l
View Tutorial          By: Achi at 2008-01-08 04:21:57

3. any one help i want to create servermail apllicati
View Tutorial          By: Nouman at 2014-10-28 05:10:15

4. can I ask question? how to make a complete program
View Tutorial          By: manuel at 2012-08-13 10:06:24

5. This website is great for the students who want to
View Tutorial          By: Parth Patalia at 2009-11-19 21:09:24

6. It is very useful for me guyzz......thanx.......:-
View Tutorial          By: Rajesh at 2012-09-29 10:11:45

7. When I tried to run this code, I got time out ***
View Tutorial          By: Gandhi at 2009-06-04 06:20:48

8. So I followed you steps with no compile errors. W
View Tutorial          By: PointLookoutResident at 2014-10-14 19:01:11

9. Hi sir, Your explain is very good sir,
View Tutorial          By: Surendra Majji at 2013-02-14 04:55:49

10. THANX FOR THE INFO....
View Tutorial          By: Abhinaykumar at 2010-07-06 11:34:53