SCJP 1.6版考題 154

出自 陳富國維基館
於 2013年3月30日 (六) 02:53 由 Ikk (對話 | 貢獻) 所做的修訂 (新頁面: Given that c is a reference to a valid java.io.Console object, which two code fragments read a line of text from the console? (Choose two.) A. String s = c.readLine(); B. char[]...)
(差異) ←上個修訂 | 最新修訂 (差異) | 下個修訂→ (差異)
前往: 導覽搜尋
Given that c is a reference to a valid java.io.Console object, 
which two code fragments read a line of text from the console? (Choose two.)
 A. String s = c.readLine();
 B. char[] c = c.readLine();
 C. String s = c.readConsole();
 D. char[] c = c.readConsole();
 E. String s = c.readLine("%s", "name ");
 F. char[] c = c.readLine("%s", "name ");

解答


Ans: A E

解說: 給定一個c是一個指向一個有效的java.io.Console 物件,那二個敘述可以從console讀取一行文字