Exam 1z0-809 All QuestionsBrowse all questions from this exam
Question 170

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?

    Correct Answer: C

    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.

Discussion
jduarteOption: A

Answer is A

WilsonKKerllOption: C

if Option is.-ea , answer is C java.lang.AssertionError. if Option is -da , answer is 10.

steefaandOption: A

A is true assuming ""da means -da.

duydnOption: A

to enable assert: -ea to disable assert: -de

steefaand

It's actually -da (or -disableassertions) to disable assertions