aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Method overloading Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Method overloading
 
Similar Threads
Barry Boone #29
Question from New Boone
Primitive Data Types
boone exam q -- assignments, help
Why this Output?