Just came to know that java
does has a method named printf
, then what is the difference between printf
& println
?
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.