difference between printf and println in java?

java, printf, println

Solution

`System.out.println();` is efficient for simply printing a line of text. If the line of text needs to be formatted (ex: alignment (left-justified, etc.), etc.), then `System.out.printf();` would be used.

Check out this link for more information.

Problem

Just came to know that `java` does has a method named `printf`, then what is the difference between `printf` & `println`?

Original source

Related problems