What is the result?

Given the code fragment:
<code>
int b = 3;
if ( !(b > 3)) {
System.out.println(“square “);
}{
System.out.println(“circle “);
}
System.out.println(“…”);
</code>
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 1

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


D

D

Ans:C

But the output console statement should be print instead of println.