This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes Variable argument (VARARGS) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Java in General
Bookmark "Variable argument (VARARGS)" Watch "Variable argument (VARARGS)" New topic

Variable argument (VARARGS)

anisha bhushan

Joined: May 31, 2012
Posts: 2
i have an error in this program regarding vargs..actuallly two

Sir i dont knw why but its giving two errors. the same happens with any vargs program. i”m new to java programming so please help me out..
the two errors are: (identifier expected)
public static void test(int some, String… args) (identifier expected)
2 errors.
please help me out…
Swastik Dey

Joined: Jan 08, 2009
Posts: 1508


What version of java do you have?

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14949

Welcome to the Ranch.

Your program looks perfectly ok. Varargs were new in Java 5. If you're using Java 1.4 or older then you cannot use varargs.

Check your Java compiler and runtime version with these commands:

java -version
javac -version

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
anisha bhushan

Joined: May 31, 2012
Posts: 2
Thankyou.. i have an older version of java and the program is running perfectly on eclipse. thanks for your response. sorry to bother you..
Have you checked out Aspose?
subject: Variable argument (VARARGS)
jQuery in Action, 3rd edition