• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Override Vs Redefinition

 
Sundararaj Govindasamy
Ranch Hand
Posts: 46
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai Folks,
I have a doubt . What is difference between redefinition and overriding?

In kathy's book, page 147 . I found the following code fragments..

class Animal{
static void doStuff(){
System.out.print("a");
}
}
class Dog extends Animal{
static void doStuff(){
System.out.print("d");
}
}
Here both doStuff() method signatures are identical right ? Then , why they are called "redefined " here instead of overriding ? Give me more informations regards this .
Thank you in advance
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See Overriding vs. Hiding.
 
Sundararaj Govindasamy
Ranch Hand
Posts: 46
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Marc.
The link provided by you is nice and useful . I am now clear about this topic.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic