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
  • 370
  • 4
  • 16

1 Answers1

3

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

Louis Wasserman
  • 182,351
  • 25
  • 326
  • 397