my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Tricky question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Tricky question" Watch "Tricky question" New topic

Tricky question

Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
I was reading the Java Language specification and I found this interesting code snippet about method overriding, hiding and overloading...

I did not read this in any book before:

What will be printed?

The output is:
Goodnight, Dick.

Does anyone knows why?
I agree. Here's the link:
subject: Tricky question
Similar Threads
Invocation of Hidden Class Methods
static methods/casting question
static methods Help plz..
Static Method and Inheritence.
Duplicate Method Names