FranXh
FranXh

Reputation: 4771

Declaring an array of Strings

I want to declare an array of strings but Java is complaining when I do this: String[] ss = ("A", "B", "C", "D");

What am I doing wrong?

Upvotes: 3

Views: 261

Answers (1)

Hunter McMillen
Hunter McMillen

Reputation: 61515

Try replacing the parentheses with braces:

String[] ss = {"A", "B", "C", "D"};

Upvotes: 10

Related Questions