john
john

Reputation: 2672

from Java to Groovy : how to handle "String myArray[]"

I tried to to compile Java files using groovyc command. When it hits

public static void main(String myArray[])

that is in Java file, the compiler says:

unexpected token: [ @line xxxxx

how could I handle this situation in general - these might be a lot of cases in Java files?

thanks.

Upvotes: 4

Views: 166

Answers (1)

Erich Kitzmueller
Erich Kitzmueller

Reputation: 36987

It's simply

 public static void main(String[] myArray)

or (more groovy)

static main(myArray)

Upvotes: 5

Related Questions