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. Nice article..
View Tutorial          By: senthil at 2009-09-09 00:22:40

2. Hi Devi, After you download the 5 programs you nee
View Tutorial          By: Ramlak at 2008-04-01 01:51:42

3. I had a problem, which is the password when window
View Tutorial          By: jua at 2013-09-16 23:16:27

4. can you give me tutorial how to copy phonebook to
View Tutorial          By: rico at 2010-04-04 21:07:57

5. good for us
View Tutorial          By: soumen chakraborty at 2008-08-25 01:28:30

6. ahmm I guess This is a VB6 program? or how can I g
View Tutorial          By: kelvin at 2011-02-27 14:07:44

7. There is 3rd Party webservices hosted over HTTPS,
View Tutorial          By: Ankur at 2012-02-24 16:49:59

8. Good work. Although it would be nicer if you can p
View Tutorial          By: frisked09 at 2011-05-26 23:52:34

9. Nice example. I think this is more idiomatic tho'.
View Tutorial          By: John Morrison at 2010-03-28 14:55:07

10. I need to get the brief notes on this example

View Tutorial          By: Racchana Srini at 2014-07-29 07:50:22