Solved

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

Posted on 2007-11-21
6
1,553 Views
Last Modified: 2013-12-29
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
Comment
Question by:tiger0516
  • 3
  • 2
6 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 30 total points
ID: 20331914
That mean a variable number of arguments
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20331917
0
 
LVL 92

Assisted Solution

by:objects
objects earned 20 total points
ID: 20331942
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:tiger0516
ID: 20331964
It the length is variable, why I get a complier error when passing just one?
0
 
LVL 92

Expert Comment

by:objects
ID: 20331972
are you sure you are using the same class as expected (and not one with samne ane from another package)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20476706
:-)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question