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
Thanks great your tutorial. i want to wr

View Tutorial          By: fatima at 2009-08-29 00:15:27

2. I like your linked list program. i've one doubt di
View Tutorial          By: silambarasan at 2013-01-25 03:11:48

3. To DD -

The comment you just posted

View Tutorial          By: Alex at 2011-09-30 10:36:11

4. more info needs to be given ............
View Tutorial          By: sufficient for new commer at 2008-05-09 00:41:58

5. To install 32 bit java Communication API you can f
View Tutorial          By: Shailendra at 2013-04-06 14:49:44

6. This works perfect for me. The only big problem is
View Tutorial          By: Eric at 2014-11-20 03:49:19

7. Good Luck....
View Tutorial          By: nagarajan at 2011-06-19 03:55:49

8. hi! i want to know about how database createed in
View Tutorial          By: kundan at 2010-05-19 05:03:33

9. my question is the same of sajjad.what about (!iss
View Tutorial          By: hossain at 2012-04-26 04:28:56

10. Can u tall me about the job market of J2ME.
View Tutorial          By: mimdad07 at 2009-06-26 14:40:26