Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam 1z0-809 topic 1 question 107 discussion

Actual exam question from Oracle's 1z0-809
Question #: 107
Topic #: 1
[All 1z0-809 Questions]

Given the code fragment:

What is the result?

  • A. A compilation error occurs at line n1.
  • B. A compilation error occurs at line n2.
  • C. The code reads the password without echoing characters on the console.
  • D. A compilation error occurs because the IOException isn't declared to be thrown or caught?
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
asdfjhfgjuaDCV
1 month, 1 week ago
C is the correct answer
upvoted 1 times
...
steefaand
2 months, 2 weeks ago
Selected Answer: C
With given options answer is C. Since input is read from user and it is not printed. Also System.console() might return null if console is not available and NPE might be thrown, but that option is not in answers.
upvoted 1 times
...
iSnover
2 months, 2 weeks ago
Selected Answer: C
C. The code reads the password without echoing characters on the console. tested
upvoted 1 times
...
push05
3 months ago
import java.io.Console; public class Main { public static void main (String[] args) { Console console = System.console(); char[] pass = console.readPassword("Enter password:"); // line n1 String password = new String(pass); // line n2 } } C:\cjava\809>javac Main.java C:\cjava\809>java Main Enter password: C:\cjava\809> Answer is C
upvoted 1 times
...
Kim514
1 year ago
Answer is : C
upvoted 1 times
...
Ohayou
2 years, 1 month ago
Answer is : C
upvoted 2 times
...
petetsai
2 years, 3 months ago
C tested, on windows 10 CMD.
upvoted 2 times
...
Eason_from_the_future
2 years, 7 months ago
Answer is A. Exception in thread "main" java.lang.NullPointerException
upvoted 1 times
vancuver
2 years, 7 months ago
This is a bug #122429 of eclipse
upvoted 3 times
...
...
Sigamani
2 years, 11 months ago
C is correct
upvoted 3 times
...
jduarte
3 years ago
Answer C. Tested
upvoted 3 times
...
Manuel7000
3 years ago
Answer is A.
upvoted 1 times
...
fffff
3 years, 2 months ago
C. The code reads the password without echoing characters on the console. tested
upvoted 4 times
...
pul26
3 years, 4 months ago
Answer is D tested
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...