Question: b.) i.) numberFormatException ii.) ArrayIndexOutofBoundException iii.)
ID: 3549928 • Letter: Q
Question
Question:
b.) i.) numberFormatException
ii.) ArrayIndexOutofBoundException
iii.)IllegalArgumentException
Please check my b answer,
amd c how to do, using comment to explain?
Explanation / Answer
i) String message = "hello";
System.out.println(message.charAt(5));
trying to access 5 which is out of bound so Exception is ArrayIndexOutofBoundException
ii) double[] array = new double[7];
System.out.println(array[7]);
trying to access 7 which is out of bound so Exception is ArrayIndexOutofBoundException
iii) JButton bt;
bt.setText("submit");
NullPointerException because bt object not initialized.
c) statement to draw circle with radius 15 centered at (40,40) given g
drawCircle(g, 40, 40, 5);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.