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. Thanks for the tutorial.

One questi

View Tutorial          By: Stephen at 2012-06-09 06:36:23

2. Hi ngocanh, You are right. The client has to be in
View Tutorial          By: Emiley J at 2013-07-14 05:51:35

3. Nothing that hasn't been said before, but I wasn't
View Tutorial          By: Calvin at 2010-03-22 20:43:10

4. Can you give some examples of do while & pleas
View Tutorial          By: mhilan at 2011-09-01 04:54:13

5. I used a txt file and stored it under my drawable
View Tutorial          By: Sara at 2014-09-18 16:33:30

6. I have a question. So here I have a progress bar,
View Tutorial          By: Nick at 2011-12-06 05:10:19

7. i want to know how to read a file inside zipfile.<
View Tutorial          By: iman at 2009-11-26 12:50:21

8. Very good tutorial, but I have a small question he
View Tutorial          By: Mohammad NABIL at 2010-07-20 05:58:19

9. whether the below command will work
Math o

View Tutorial          By: Gowrish Sagar at 2015-10-05 10:36:35

10. very good and very simple for beginers
View Tutorial          By: Biju Thomas at 2010-08-17 08:09:30