Java Console printf() MethodThe printf() method of Console class is used to write a formatted string to this console's output stream. This method used a specific format of string 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: If a format string contains an illegal syntax. Example 1Output: Sum of 12 and 45 is 57. Example 2Output: Enter first value 12 Enter second value 23 First value 12 Second value 23 Addition is: 35. Example 3Output: cse program language ----- ----- -----PHP Java Python CSS Html JavaScript
Next TopicJava Console Class
|