method (String ... var) what does this mean?

M

Ming

What does the three dots after string mean?

I have a class that have a method itemLookup(ItemLookupRequest...
request)

I pass an ItemLookupRequest object to the method and it is wrong. What
does the three dots mean?

Thanks,
 
D

Daniel Pitts

Ming said:
What does the three dots after string mean?

I have a class that have a method itemLookup(ItemLookupRequest...
request)

I pass an ItemLookupRequest object to the method and it is wrong. What
does the three dots mean?

Thanks,
The three dots means its a varargs method, it can take zero or more
ItemLookupRequest objects...

By "it is wrong", do you mean it doesn't do what you expect, or that you
get a compiler error? Copy and paste the exact error you're getting.
 
M

Ming

Thanks for reply.

It is a compiler error

Thanks for reply.

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,
 
D

Daniel Pitts

Ming said:
Thanks for reply.

It is a compiler error

Thanks for reply.

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,
Please don't top post in the future.

What version of Java are you using? Try compiling it, and paste the
*exact* message.
 
R

ricardorq85

Maybe your method is overloaded.

May you show the entire source?

Roedy Green ha escrito:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top