Computer Science, asked by prathyushkumar4209, 1 year ago

Which is valid syntax to declare and initialize a string variable?

Answers

Answered by clue
2

You can do the following during declaration:

String names[] = {"Sarah","James","John"};

And if you want to do this somewhere after declaration:

String names[];

names = new String[] {"Sarah","James","John"};

Similar questions