Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Method invocation promotion in java

 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The result is short. My question is, When a method is called, What about method invocation promotion? byte, short, char are promoted to int and passed to corresponding method with signatures. Is that correct?

Thanks in advanced!
 
Venu Chakravorty
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A datatype (here byte) is promoted to the narrowest datatype (here short) that is big enough to hold the value (here 100).

regards, venu.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic