What is the output? 10/29/2018 – by Mod_GuideK 2 Given the following code: What is the output? A. 44 B. 35 C. 47 D. 54 E. 45 F. 4 21 SHOW ANSWERSCorrect Answer: E Explanation/Reference: Download Printable PDF. VALID exam to help you PASS.
public static void main(String[] args) { String [] planets={“Mercury”,”Venus”,”Earth”,”Mars”}; System.out.println(planets.length); System.out.println(planets[1].length()); } result : 4 5 2 Reply
public static void main(String[] args) {
String [] planets={“Mercury”,”Venus”,”Earth”,”Mars”};
System.out.println(planets.length);
System.out.println(planets[1].length());
}
result :
4
5
the answer is :
4
5
none of the above