阿摩線上測驗 登入

試題詳解

試卷:104年 - SCJP 151-200#99330 | 科目:OJCP(SCJP)

試卷資訊

試卷名稱:104年 - SCJP 151-200#99330

年份:104年

科目:OJCP(SCJP)

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, what is the result?
(A) pw: got fido name: bob got bob
(B) pw: fido got fido name: bob got bob
(C) pw: got fido name: bob got bob
(D) pw: fido got lido name: bob got bob
(E) Compilation fails. 
正確答案:登入後查看