Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

string array varargs

 
akila sekaran
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is String...[] args a legal one ?
 
Alexei Kaigorodov
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
akila sekaran wrote:is String...[] args a legal one ?

No.
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic