Which of the following Java declaration of the String array is correct?
String temp [] = new String {"j" "a" "Z"};
String temp [] = { "j""b" "C"};
String temp = {"a", "b", "c"};
String temp [] = {"a", "b", "c"};
Answers
Answer:
1st, 2nd and 4th are correct.
Option 4 is correct, that is: String temp [] = {"a", "b", "c"};
What is string?
Strings are collections of characters that are frequently used in Java programming. Objects in the Java programming language include strings. For creating and manipulating strings, the Java platform offers the String class.
What is Array?
Java uses non-primitive data types called arrays to store items of a certain data type in memory. A container object called an array carries a predetermined number of values of a single kind. When an array is constructed, its length is predetermined. Its length is fixed once it is created.
What is string array in java?
A definite number of String values make up a String Array. An ordered string of characters. In general, a string is an immutable object, meaning its value cannot be altered. Similar to other Array data types, the String Array operates similarly. Only a predetermined number of elements can be stored in an array.
To know more about Java, use the given link:
https://brainly.in/question/13895848?referrer=searchResults
#SPJ2