SCJP 1.6版考題 143

出自 陳富國維基館
前往: 導覽搜尋
Given: System.out.printf("Pi is approximately %f and E is approximately %b, Math.PI, Math.E);
Place the values where they would appear in the output.

SCJP143-1.png

解答


Ans:
SCJP143-2.jpg

解說:

%f float
%b boolean
System.out.printf 仿c時代的printf功能,指定格式輸出