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. how can i use <img> tag in message body?

View Tutorial          By: Sonal at 2012-11-07 07:05:33

2. hello everyone

i want to implement

View Tutorial          By: Prateek at 2010-09-05 00:40:57

3. hi i m vinit jain. i m working on the same project
View Tutorial          By: vinit jain at 2010-02-09 12:16:01

4. hi.I am new in j2me and really want to learn more.
View Tutorial          By: grace at 2010-10-25 10:40:32

5. can we do it this procedure by iteration i know th
View Tutorial          By: sattar at 2010-05-03 03:00:20

6. nice!!!!
View Tutorial          By: svk at 2013-01-17 19:59:05

7. This works with inserts but it is very slow for lo
View Tutorial          By: Antonio Pereira at 2011-02-04 08:54:45

8. I find dis site very educating
View Tutorial          By: Kensho at 2009-05-09 05:18:57

9. HI.....

javax.comm.NoSuchPortExcept

View Tutorial          By: RAHUL at 2010-12-28 22:59:41

10. I have mobile connecting to pc 3 options come com
View Tutorial          By: Sumit Sharma at 2012-04-13 16:32:15