問題詳情
157.Given that c is a reference to a valid java.io.Console object, and: 11. String pw = c.readPassword("%s", "pw: "); 12. System.out.println("got " + pw); 13. String name = c.readLine("%s", "name: "); 14. System.out.println(" got", name); If the user types fido when prompted for a password, and then responds bob when prompted for a name, whatis the result?
(A) pw:got fidoname: bobgot bob
(B) pw: fidogot fidoname: bobgot bob
(C) pw:got fidoname: bob got bob
(D) pw: fidogot lidoname: bob got bob
(E) Compilation fails.
參考答案