[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1572
  • Last Modified:

What does the three dots in method parameters mean (like method (String... s)

Code snippet:

AmazonECS service = new AmazonECSQuery(accessKeyId, associateTag);
...
ItemLookupRequest request=new ItemLookupRequest();
...
ItemLookupResponse response = service.itemLookup(request);

Eclipse complains that

The method itemLookup(ItemLookupRequest...) in the type AmazonECS is
not applicable for the arguments (ItemLookupRequest)    Test/src/com/
amazon/webservices/test AWSTest.java

Thanks
0
tiger0516
Asked:
tiger0516
  • 3
  • 2
2 Solutions
 
CEHJCommented:
That mean a variable number of arguments
0
 
objectsCommented:
thats the new(ish) varargs feature add in 1.5
see here for some details

http://java.sun.com/developer/JDCTechTips/2005/tt0104.html#1
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
tiger0516Author Commented:
It the length is variable, why I get a complier error when passing just one?
0
 
objectsCommented:
are you sure you are using the same class as expected (and not one with samne ane from another package)
0
 
CEHJCommented:
:-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now