Given: What is the result?
A.
Number us : 12345
B.
AnArrayIndexOutOfBoundException is thrown at runtime.
C.
A NullPointerException is thrown at runtime
D.
A NumberFormatException is thrown at runtime
Given: What is the result?
A.
Number us : 12345
B.
AnArrayIndexOutOfBoundException is thrown at runtime.
C.
A NullPointerException is thrown at runtime
D.
A NumberFormatException is thrown at runtime
Here (B) is the answer
I tested the program public class TestInt {
public static void main(String[] args) {
Integer num = Integer.parseInt(args[1]);
System.out.println(num);
}
}
ANSWER is A.
b
Answer is B. The String only have one element.
The String[] only have one element.