This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes string array varargs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "string array varargs" Watch "string array varargs" New topic

string array varargs

akila sekaran
Ranch Hand

Joined: Jun 12, 2012
Posts: 48
is String...[] args a legal one ?
Alexei Kaigorodov

Joined: Feb 24, 2008
Posts: 17
akila sekaran wrote:is String...[] args a legal one ?

gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924

akila sekaran wrote:is String...[] args a legal one ?

this is not correct syntax. but String[]...args is a correct syntax for var-args of String arrays. but if you try to do this

public static void main(String[]...args) // will give Error. violates the signature of main method
subject: string array varargs
It's not a secret anymore!