Question 21 / 90:  Regarding to the given code, what integer declarations are needed to print the string fragile!?
public class StringModifier {

public static void main(String[] args) {

String a = "Supercalifragilisticexpialidocious!";

String b = a.substring(x, y);

char [] c = {a.charAt(u), a.charAt(v)};

System.out.println(b + String.valueOf(c));

}

}

A  int x = 8; int y = 14; int u = 2; int v = 33;
B  int x = 10; int y = 16; int u = 4; int v = 35;
C  int x = 8; int y = 15; int u = 5; int v = 32;
D  int x = 9; int y = 15; int u = 3; int v = 34;
<< First < Previous Next > Last >>
Explanation:

D. The integer declarations supplied in answer D causes the printing of fragile!

A, B, and C are incorrect.

A is incorrect because the integer declarations supplied causes the printing of ifragips.

B is incorrect because the integer declaration causes a StringIndexOutOfBoundsException exception to be thrown since there are only 34 characters to be accessed, not 35.

C is incorrect because the integer declaration causes the printing of ifragilcu.

Exam Home Page
https://www.jobilize.com/quiz-my-oca-mock-exam-by-mike-wolf

My OCA Mock

Author:

Access: Public Instant Grading

Ask
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/quiz-my-oca-mock-exam-by-mike-wolf" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>