Question 33 / 35:  output ?
public class Kalra8 {

static int x = 7;

public static void main(String[] args) {

String s = "";

for (int y = 0; y < 3; y++) {

x++;

switch (x) {

case 8:

s += "8 ";

case 9:

s += "9 ";

case 10: {

s += "10 ";

break;

}

default:

s += "d ";

case 13:

s += "13 ";

}

}

System.out.println(s);

}

static {

x++;

}

}

A  9 10 d
B  9 10 10 d 13
C  8 9 10 9 10 10 d 13
D  Compilation fails
E  8 9 10 10 d 13
<< First < Previous Next > Last >>
Quiz Home Page
https://www.jobilize.com/ocjp-1z0-803-oca1-7-mock-exam-part-ii-quiz-by-pankaj-amdocs-gurg

OCA(1z0-803_OCA1.7)MockExamPII

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/ocjp-1z0-803-oca1-7-mock-exam-part-ii-quiz-by-pankaj-amdocs-gurg" 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>