Java PrintStream print() methodThe print() method of java PrintStream class consist of 9 types with parameters :-
Java PrintStream print(boolean b) MethodThe print(boolean b) method of java PrintStream class prints a value whose type is boolean. SyntaxParameterb - the Boolean value. ReturnsNA Example 1Test it NowOutput: Printing boolean value.... true Example 2Output: printing boolean value... Done !, check the text file. Java PrintStream print(char c) MethodThe print(char c) method of java PrintStream class prints a character value. SyntaxParameterc - the character to be printed. ReturnsNA Example 1Test it NowOutput: Printing char value.... A Example 2Output: printing char value... Done !, check the text file. Java PrintStream print(char[] c ) MethodThe print(char[] c) method of java PrintStream class prints an array of characters. SyntaxParameterc - the array of chars to be printed. ReturnsNA Example 1Test it NowOutput: Printing char array value... shubham jadon Example 2Output: printing char array value... Done !, check the text file. Java PrintStream print(int i) MethodThe print(int i) method of java PrintStream class prints an integer value. SyntaxParameteri - an integer value. ReturnsNA Example 1Output: printing int value... Done !, check the text file. Example 2Test it NowOutput: Printing int value... 1031997 Java PrintStream print(long l ) MethodThe print(long l) method of java PrintStream class prints a long value. SyntaxParameterl - the long value to be printed. ReturnsNA Example 1Output: printing long value... Done !, check the text file. Example 2Test it NowOutput: Printing long value... 1031997 Java PrintStream print(float f) MethodThe print(float f) method of java PrintStream class prints a floating-point number. SyntaxParameterf - the float value. ReturnsNA Example 1Test it NowOutput: Printing float value... 10.0 Example 2Output: printing float value... Done !, check the text file. Java PrintStream print(double d) MethodThe print(double d) method of Java PrintStream class prints a double value. SyntaxParameterd - the double value. ReturnsNA Example 1Test it NowOutput: Printing double value... 10.0 Example 2Output: printing double value... Done !, check the text file. Java PrintStream print(String s) MethodThe print(String s) method of Java PrintStream class prints a String value. If the specified argument is null then the string "null" is printed. SyntaxParameters - the string value. ReturnsNA Example 1Test it NowOutput: Printing String value... my name is shubham jadon Example 2Output: printing String value... Done !, check the text file. Java PrintStream print(object obj) MethodThe print(object obj) method of Java PrintStream class prints an object. SyntaxParameterobj - the object to be printed. ReturnsNA Example 1Test it NowOutput: Printing object value... my name is shubham jadon Example 2Output: printing object value... Done !, check the text file.
Next TopicJava PrintStream
|