Single Choice
Not Set
QDetermine output:
public class Test{
public static void main(String args[]){
String str = null;
if(str.length() == 0){
System.out.print("1");
}
else if(str == null){
System.out.print("2");
}
else{
System.out.print("3");
}
}
}
ID: #2228
String in Java
1,541 views
Question Info
#2228Q ID
Not SetDifficulty
String in JavaTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
An exception is thrown at runtime.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic