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 Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Method overloading" Watch "Method overloading" New topic

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.
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.

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.

SCJP Tipline, etc.
I agree. Here's the link:
subject: Method overloading