Given the code fragment:
int b = 3;
if ( !(b > 3)) {
System.out.println(“square “);
}{
System.out.println(“circle “);
}
System.out.println(“…”);
What is the result?
A.
square…
B.
circle…
C.
squarecircle…
D.
Compilation fails.
Given the code fragment:
int b = 3;
if ( !(b > 3)) {
System.out.println(“square “);
}{
System.out.println(“circle “);
}
System.out.println(“…”);
What is the result?
Given the code fragment:
int b = 3;
if ( !(b > 3)) {
System.out.println(“square “);
}{
System.out.println(“circle “);
}
System.out.println(“…”);
What is the result?
A.
square…
B.
circle…
C.
squarecircle…
D.
Compilation fails.
C. would have been right if Syste.out.print were used instead of println. so none of the above answers is ok!
I agree but I guess since the only choices were actual outputs and “compilation fails”, it was assumed.
I guess the creator of this question didn’t really take much stock in syntax, huh? lol.