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. Clear explaination..Thank You Sir...
View Tutorial          By: nishanth at 2014-06-16 08:58:04

2. how to get only the year like 2012
View Tutorial          By: Iguster at 2012-01-27 22:20:32

3. Post your errors, so that others may help you my f
View Tutorial          By: yogesh at 2010-01-12 00:45:42

4. Good
View Tutorial          By: sandesh at 2009-10-01 01:15:29

5. hello!!can anyone help me. can you send me the com
View Tutorial          By: denisse at 2008-01-07 05:40:25

6. very good
View Tutorial          By: pravin gajbhiye, nagpur at 2010-05-24 01:43:30

7. Awesome code workings fro me thank you so much :)
View Tutorial          By: Shripad at 2012-01-24 08:58:03

8. give me some logics for programs as soon as possib
View Tutorial          By: nari at 2011-12-07 18:28:03

9. nice explanation
View Tutorial          By: harish at 2012-12-04 06:20:45

10. very nice content
View Tutorial          By: jagadeesh at 2012-04-25 06:24:03