Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

K & B typo ?  RSS feed

 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Which produces the output:

int int long double

This probably isn't much of a surprise; the calls that use byte and the short arguments are implicitly widened to match the version of the go() method that takes an int. Of course, the call with the long uses the long version of go(), and finally, the call that uses a float is matched to the method that takes a double.


In every case, when an exact match isn't found, the JVM uses the method with the smallest argument that is wider than the parameter.--Chapter 3, K & B


In the quote above, arent the words parameter and arguments got interchanged. I think it should have been

"smallest parameter that is wider than the argument"
[ December 09, 2008: Message edited by: Himalay Majumdar ]
 
Ranch Hand
Posts: 488
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would agree with you. I can't believe I had to read code and an explanation on the code for a mistyped quote though. Giving you a hard time, but good catch.
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Himalay, please share the problems/doubts that you face in this forum. We will try to solve the issues. And it may also help others preparing for the exam.
 
Himalay Majumdar
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure Raj, thanks for the support
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!