aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Method overloading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Method overloading" Watch "Method overloading" New topic
Author

Method overloading

geetha nagarajan
Ranch Hand

Joined: Jul 13, 2001
Posts: 94

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

Joined: Dec 20, 2001
Posts: 3271
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


SCJP Tipline, etc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Method overloading