What is the result of the following Java coding snippet?
class TestApp {
public static void main() {
int odd = 1;
if (odd) {
System.out.println("odd");
} else {
System.out.println("even");
}
}
}
Select one:
A. odd
B. Type mismatch error
C. Run-time exception
D. even
Answer is: B.Type mismatch error
Comments
Leave a comment