SCJP題庫第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 ");

Ans: AE

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

Comments

Popular posts from this blog

Android-使用webview在V3版的Google地圖GPS定位