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. This is a simple app and its working good.......
View Tutorial          By: sathish at 2012-04-23 12:16:07

2. This has tread error , copy and paster hole code a
View Tutorial          By: Daniel at 2015-01-21 16:24:36

3. Clear explanation and clear architecture diagram..
View Tutorial          By: safiya begam at 2011-05-09 06:28:51

4. Please, I need help, how can i write a program &qu
View Tutorial          By: LULU at 2012-11-23 01:34:07

5. can you tell me how can i install javax.comm.* lib
View Tutorial          By: chinthaka at 2011-06-22 09:30:29

6. i hav d same error as sudhir has "INVALID PO
View Tutorial          By: JAY SHAH at 2011-02-14 09:33:12

7. Thank You So Much . .. .. .
Very Nice Expl

View Tutorial          By: salman at 2012-07-05 13:22:11

8. thanks for providing such services...
View Tutorial          By: vara at 2008-11-18 02:07:17

9. we generally use this keyword for referring to the
View Tutorial          By: madhu at 2012-02-07 14:11:57

10. can this code communicate with other pc that using
View Tutorial          By: lolo at 2011-10-28 09:14:30