Exam 1z0-829 All QuestionsBrowse all questions from this exam
Question 16

Given the code fragment:

Which code at line n1, obtains the java.io.Console object?

    Correct Answer: B

    The correct way to obtain a java.io.Console object is by using the System.console() method. This method returns the unique Console object associated with the current Java virtual machine, if any. None of the other options correctly initialize or obtain a Console object. Therefore, the correct choice is: Console console = System.console();

Discussion
SampsOption: B

B is correct

xplorerpjOption: B

B is right answer