Java Output Formatting

  • + 1 comment

    The error is because there exists no method called "println" that has the signature (String, Object...), which is what you're attempting to write. It has nothing to do with the functionality of the println method. System.out.println takes an Object argument only, and is used to simply print an Object's String representation (via toString) to the console with a trailing newline. System.out.printf is used for formatted output, and requires the \n for printing the newline.