What is the result?

Given:
public static void main(String[] args) {
String str = "null";
if (str == null) {
System.out.println("null");
} else (str.length() == 0) {
System.out.println("zero");
} else {
System.out.println("some");
}
}
What is the result?
A. null
B. zero
C. some
D. Compilation fails.
E. An exception is thrown at runtime.

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.