日期:2014-05-20  浏览次数:20750 次

Format格式输出的问题





import java.io.Console;
  public class FormatDemo
  {
   public static void main(String[] args)
   { 
    int i = 100;
    boolean status = true;
    String str="Welcome";
    Console cons=System.console();
    cons.format(String.format("%1$d%2$b%3$s",i,status,str));
    
   }
  } 

怎么只能输出第一个数呢?

------解决方案--------------------
我拷了你的代码,输出结果是三个都输出来,不是你说的结果,你再执行一遍看