0

I have a simply doubt about syntax in Java related with Strings. Could some one tell me what is the difference between the strings in the following code?

String[] firstS = {"word1","word2"};
String secondS[] = {"word1","word2"};

I can not realize what is the difference because doing some for loop both String have the same output.

Thank you so much.

Razvi
  • 400
  • 4
  • 17

1 Answers1

3

There is no difference, but the first is often considered better style.

Louis Wasserman
  • 191,574
  • 25
  • 345
  • 413