Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tricky question  RSS feed

 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!