2009年2月17日 星期二

第154題

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 ");

答案:AE
參考:10-2 Console類別
-------------------------------------------------------------------------------------------------
從主控台的模式下讀取一列資料
String s = c.readLine...

沒有留言:

張貼留言