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. Thks a lot..... The way of giving explanation and
View Tutorial          By: Hari at 2011-04-08 02:58:06

2. Till now, I have'nt done any certifications. I am
View Tutorial          By: Subhash at 2012-03-15 10:48:29

3. Hi, If any body was able to send the message suces
View Tutorial          By: kavin at 2011-03-14 06:24:18

4. As C does not support Function Overloading, there
View Tutorial          By: N at 2013-03-06 00:27:14

5. I have been hunting around for clarification whet
View Tutorial          By: MKP at 2013-02-06 09:08:27

6. This tutorial is really fantastic.It helped me a l
View Tutorial          By: LakshmiNaryana Gorantla at 2010-04-19 23:35:45

7. i get this error too.
: Parent: child proce

View Tutorial          By: Anon at 2009-02-25 08:30:58

8. Nice one really helpful thanks
View Tutorial          By: Shashikant at 2012-01-06 12:00:45

9. In the 2nd example ,during the creation on object
View Tutorial          By: priyanka thakur at 2011-08-29 20:24:16

10. Best Explanation & gud example by finnaz......
View Tutorial          By: Umair Shuja at 2012-11-28 10:53:35