Comment on Tutorial - Method Overriding in Java By Henry



Comment Added by : georgy

Comment Added at : 2009-10-22 03:13:01

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 , sending of sms is failing. Please help me in
View Tutorial          By: sudhakar at 2009-06-19 09:39:55

2. I'm trying to learn navigating between activities.
View Tutorial          By: Ben at 2012-01-17 23:42:38

3. can i have sample of java programming that has dat
View Tutorial          By: piolo at 2009-05-31 18:53:25

4. hi its working nice,can u plz help me how to fetch
View Tutorial          By: Manju gowda at 2014-02-21 07:23:44

5. Hi Avipriya Sharma follow this link for my multi t
View Tutorial          By: Issac at 2011-06-27 00:17:21

6. the correct 255's binary representation is:

View Tutorial          By: SD.Plox at 2008-12-30 17:51:39

7. short notes to struts,but i expect more explanatio
View Tutorial          By: jayashri at 2011-11-23 18:24:07

8. I get an error " javax.mail" does not ex
View Tutorial          By: bhavin at 2009-02-03 05:50:08

9. why java from two to the power 7 bit was upgraded
View Tutorial          By: avinash at 2013-05-28 08:34:24

10. i've run d program and its works
View Tutorial          By: okeaghala nneka at 2012-03-31 10:58:13