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?

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.



Leave a Reply 2

Your email address will not be published. Required fields are marked *


mnish

mnish

C. would have been right if Syste.out.print were used instead of println. so none of the above answers is ok!

lolwut?

lolwut?

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.