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-819 topic 1 question 189 discussion

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

Given:



and the command:

java ConsoleTest

The user will input Duke and Java when the input is prompted.

What is the output?

  • A. Input Name: Duke -
    Input Password:
    Name is: Duke, Password is: Java
  • B. Input Name: Duke -

    Input Password: Java -
    Name is: Duke, Password is: Java
  • C. Input Name: Duke -
    Input Password:
    Name is: Duke, Password is:
  • D. Input Name: Duke -

    Input Password: Java -
    Name is: Duke, Password is: [C@4f6ee6e4
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Omnisumem
2 weeks ago
Selected Answer: A
to check for yourself: import java.util.*; import java.lang.Object.*; import java.io.Console; public class q189{ public static void main (String args[]){ Console console = System.console(); var name = console.readLine("Input Name: "); var password = console.readPassword("Input Password: "); System.out.println ("Name is: " + name + ", Password is: " + String.valueOf(password)); }}
upvoted 1 times
...
ASPushkin
3 months, 2 weeks ago
Selected Answer: A
String public static String valueOf(char[] data)) java.io.Console public char[] readPassword() Returns: A character array containing the password
upvoted 1 times
...
d7bb0b2
3 months, 3 weeks ago
Selected Answer: A
A is correct eadpassword retrive a char[], but in print method uses toString method for this pass visible
upvoted 1 times
...
d7bb0b2
3 months, 3 weeks ago
that is correct because, readpassword retrive a char[], but in print method uses to string for this pass is visible
upvoted 1 times
...
Felipe47
3 months, 4 weeks ago
A. Tested.
upvoted 2 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 ...