3

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?

1
  • 4
    @mre - the question is basic but it is clear, concise, well titled and potentially useful for other beginners. The answers should work as a simple howto. I think there is nothing wrong with an upvote for that..... Commented Mar 2, 2012 at 2:48

1 Answer 1

10

Try replacing the parentheses with braces:

String[] ss = {"A", "B", "C", "D"};
Sign up to request clarification or add additional context in comments.

Comments

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.