What is the output? Given the following code: What is the output? Given the following code: What is the output? A. 4 4 B. 3 5 C. 4 7 D. 5 4 E. 4 5 F. 4 21 Show Hint ← Previous question Next question →
renko Answer: E package q078; public class Test { public static void main(String[] args) { String[] planets = {“Mercury”, “Venus”, “Earth”, “Mars”}; System.out.println(planets.length); System.out.println(planets[1].length()); } } /*Output: 4 5 */ Reply
Answer: E
package q078;
public class Test {
public static void main(String[] args) {
String[] planets = {“Mercury”, “Venus”, “Earth”, “Mars”};
System.out.println(planets.length);
System.out.println(planets[1].length());
}
}
/*Output:
4
5
*/