• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Override Vs Redefinition

 
Ranch Hand
Posts: 46
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See Overriding vs. Hiding.
 
Sundararaj Govindasamy
Ranch Hand
Posts: 46
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Marc.
The link provided by you is nice and useful . I am now clear about this topic.
 
reply
    Bookmark Topic Watch Topic
  • New Topic