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

Method overloading

 
geetha nagarajan
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Both //1 & //2 call test(int ,long) ,why not test(short,int).The values are within the range of short and int,right.
Pl.help.
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by geetha nagarajan:
The values are within the range of short and int,right.
Pl.help.

That's true, the values are within the range of a short, but literal integers in your application are automatically considered ints. Check out the JLS, §3.10.1 Integer Literals.
Corey
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic