1z0-829 Exam QuestionsBrowse all questions from this exam

1z0-829 Exam - Question 16


Given the code fragment:

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

Show Answer
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

2 comments
Sign in to comment
SampsOption: B
Feb 17, 2024

B is correct

xplorerpjOption: B
Jun 25, 2024

B is right answer