What is the following code execution result?

String data[];
data = {"one", "two", "three"};
Initialization list is only allowed for usage during either array declaration:
String data[] = {"one", "two", "three"};
or array creation with the use of the new operator:
data = new String[] {"one", "two", "three"};

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Sign Up Now
or Subscribe for future quizzes