4

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.

1 Answer 1

5

It's simply

 public static void main(String[] myArray)

or (more groovy)

static main(myArray)
Sign up to request clarification or add additional context in comments.

1 Comment

You can actually usually get away with static main( args )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.