Java Console format(String fmt, Object args) MethodThe formate() method of Java Console class is used to write a formatted string to this console's output stream using the specific string format and arguments. SyntaxParametersfmt: A format string as described in Format string syntax. args: Arguments referenced by the format specifies in the format string. Return value:This method returns this console. Exception:IllegalFormatException: This exception will throw if a format string contains illegal syntax. Example 1Output: Student 34 5 CSS 2 50 Java 3 30 Example 2Output: ---- ---- ---- CSS 2 50 Java 3 30 Example 3Output: ---- ---- ----php 56 67 CSS 25 50 Java 35 30
Next TopicJava Console Class
|