Solved

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

Posted on 2007-11-21
6
1,546 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This video teaches viewers about errors in exception handling.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now