Given:
public class Counter {
public static void main (String[ ] args) {
int a = 10;
int b = -1;
assert (b >=1) : "Invalid Denominator";
int Ñ = a / b;
System.out.println (c);
}
}
What is the result of running the code with the ""da option?
Given:
public class Counter {
public static void main (String[ ] args) {
int a = 10;
int b = -1;
assert (b >=1) : "Invalid Denominator";
int Ñ = a / b;
System.out.println (c);
}
}
What is the result of running the code with the ""da option?
The code contains a typo with the variable 'c', which causes a compilation error. The variable declared and used for the division is 'Ñ', but there is an attempt to print 'c', which is undeclared and causes a compilation error.
Answer is A
if Option is.-ea , answer is C java.lang.AssertionError. if Option is -da , answer is 10.
A is true assuming ""da means -da.
to enable assert: -ea to disable assert: -de
It's actually -da (or -disableassertions) to disable assertions