试题详情
单项选择题 现有  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);      }      }      结果为:()     

A、编译失败

B、  -42-  -1234- -7.0-

C、 - 42- -1234- -7.0-

D、 - 42- -12345- -7.0-

E、运行时异常被抛出

  • E
  • 关注下方微信公众号,在线模考后查看

热门试题