This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Boxing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Boxing" Watch "Boxing" New topic


srinivas sridaragaddi
Ranch Hand

Joined: Jul 24, 2007
Posts: 225
Source Java Beat

class Boxing6 {
public static void checkThis(Double d1, Double ... d2) {
System.out.println("Double and Var-Args");
public static void checkThis(Double d1, Double d2, Double ... d3) {
System.out.println("Double , Double and Var-args");
public static void checkThis(double d1, Double d2, Double ... d3) {
System.out.println("double , Double and Var-args");
public static void main(String [] args) {
checkThis(15.5d, 26.6d, 37.7d); // line 1
compiler error.

where as i thought it sould be double,Double and Var-args.

please help me out with this

SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
Vishwanath Krishnamurthi
Ranch Hand

Joined: Jun 04, 2007
Posts: 331

For the method call, the compiler would find a match in all the three forms of checkThis() and this ambiguity causes the compiler error.


I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Boxing
It's not a secret anymore!