This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
Duplicate Method Names
static methods Help plz..
Invocation of Hidden Class Methods
static methods/casting question
Static Method and Inheritence.