Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
出力を 2 スペース右にインデントしようとしていますが、2 スペースではなく .format でインデントできますか?
System.out.format(" %-15s %7.2f %5.0f %-20s\n", getName(), payPerHour, hours, task.getTask()); ^ //2 spaces in front
そうですよ
System.out.format("%2s%-15s %7.2f %5.0f %-20s\n", " ", getName(), payPerHour, hours, task.getTask());