右对齐 左对齐 输出

int n = 123;

System.out.format("%4s\n", n);
System.out.format("%-4s\n", n);

posted on 2013-03-30 18:23  Sure_Yi  阅读(180)  评论(0编辑  收藏  举报

导航