I am trying to print display data in a tabular format with multiple headers. I am using the following printf
statement:
System.out.format("%-15s %-15s %-25s %-15s %-20s %s %n", "Id", "name", "Mode", "Total weight", "Arrival loc", "Departure loc");
But that generates the following error:
Method format in the type PrintStream is not applicable for the arguments (String, String, String, String, String, String)
What could the possible solution to print this statement with formatting?