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. sir,
my project is in asp.net so is ther

View Tutorial          By: mohsin at 2011-04-14 06:25:59

2. this works
-------------------------------

View Tutorial          By: Aeron at 2013-10-20 04:50:51

3. what are benefits of using overriding method?
View Tutorial          By: Ah Socheat at 2013-12-11 04:44:57

4. Hi Ramlak
I am trying to run your code.

View Tutorial          By: jainitya at 2011-05-04 12:26:16

5. Plz send code of sending sms from java code...

View Tutorial          By: Shekh at 2014-11-27 14:18:25

6. Great article! Simple and precise. Thanks!
View Tutorial          By: dz at 2014-10-06 04:36:56

7. I need code for read write mifare 1k card using No
View Tutorial          By: amarendra at 2010-12-02 21:12:08

8. You explained the this Keyword very well.
&

View Tutorial          By: Karan at 2012-12-04 11:27:35

9. good. very nice.
View Tutorial          By: anuprassana at 2007-03-03 04:22:42

10. program is very long
View Tutorial          By: ajit kumar at 2012-04-21 03:57:13