What is the result?

Given the code fragment
int var1 = -5;
int var2 = var1–;
int var3 = 0;
if (var2 < 0) {
var3 = var2++;
} else {
var3 = –var2;
}
System.out.println(var3);
What is the result?
A. – 6
B. – 4
C. – 5
D. 5
E. 4
F. Compilation fails

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.