單項(xiàng)選擇題

現(xiàn)有 
import java.io.PrintWriter;     
class  DoFormat{ 
public  static void main (String  []  args)  {     
int x=42; 
int y=12345;    
float Z-7 ; 
System.out.format("一%4d-",  X);
System. out.format("-%4d-",  y);    
System. out.format("-%4.ld-",z);     
}     
}     
結(jié)果為:()     

A.編譯失敗
B.  -42-  -1234- -7.0-
C. - 42- -1234- -7.0-
D. - 42- -12345- -7.0-
E.運(yùn)行時(shí)異常被拋出

題目列表

你可能感興趣的試題

微信掃碼免費(fèi)搜題