M Mỹ Duyên New member Sep 19, 2021 #1 What will be the output of the following Java program? Code: class Output { public static void main(String args[]) { String str = "true false true"; boolean x = Boolean.valueOf(str); System.out.print(x); } } A. True B. False C. Compilation Error D. Runtime Error
What will be the output of the following Java program? Code: class Output { public static void main(String args[]) { String str = "true false true"; boolean x = Boolean.valueOf(str); System.out.print(x); } } A. True B. False C. Compilation Error D. Runtime Error
N Nguyễn Việt Thắng New member Sep 19, 2021 #2 Answer: b Explanation: valueOf() returns true if the specified string contains “true” in lower or uppercase and false otherwise. Output: Code: $ javac Output.java $ java Output false Upvote 0 Downvote
Answer: b Explanation: valueOf() returns true if the specified string contains “true” in lower or uppercase and false otherwise. Output: Code: $ javac Output.java $ java Output false