agi*_*les 0 java printing printf
我使用System.out.printf方法格式化字符串并打印一行但在此之后我需要通过for循环打印另一行而不使用新行.
现在使用printf方法后,它将移动到新行.但我不需要移动新行直到打印我的for循环.
可能吗??或者你可以告诉别的方式
这是我的示例代码
System.out.printf("%7s %s%n",names[i], " ");
for(int j=0; j<5;j++){
System.out.print( grades[i][j]+ " " );
}
System.out.println();
Run Code Online (Sandbox Code Playgroud)