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. I'm getting the following error even after several
View Tutorial          By: Joe85 at 2011-03-18 08:58:04

2. Out of -1, 0, and 1 which one can I use as second
View Tutorial          By: Sanjay Bhosale at 2011-12-06 13:17:54

3. where is mysdfile.txt file created. where can i fi
View Tutorial          By: Venkatesh at 2014-11-12 10:53:52

4. nice one !!! just keep it .. i have learn a lot..
View Tutorial          By: dondon at 2011-07-27 04:43:40

5. Hi , instead of using localhost. I am using a mobi
View Tutorial          By: vimal at 2010-12-02 01:44:40

6. now I know what isset is for, thank you very much
View Tutorial          By: Anonymous at 2010-12-23 20:43:29

7. Hallo every one. I am working on my project in j2m
View Tutorial          By: radhe at 2010-12-14 08:08:25

8. hi! im new in j2me applications so i just cleaned
View Tutorial          By: resego at 2010-08-04 07:29:29

9. Good Introduction to start j2me.thanks
View Tutorial          By: Ravinder Kasarla at 2008-12-26 06:59:29

10. Hi I properly placed the Comm api settings,i have
View Tutorial          By: Muthumani at 2010-04-19 05:24:17