Java - printf

Java Conceptuel Diagram

About

printf method in Java is implemented and available with the Formatter class.

Example

public PrintStream printf(String format, Object... args)

allows you to print an arbitrary number of objects. It can be called like this:

System.out.printf("%s: %d, %s%n", name, idnum, address);

or like this

System.out.printf("%s: %d, %s, %s, %s%n", name, idnum, address, phone, email);

or with yet a different number of arguments.





Discover More
Java Conceptuel Diagram
Java - Parameter

Parameters refers to the list of variables in a method declaration. Arguments are the actual values that are passed in when the method is invoked. When you invoke a method, the arguments used must match...



Share this page:
Follow us:
Task Runner