PrintStream print(Object) method in Java with Examples Last Updated : 29 Jan, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The print(Object) method of PrintStream Class in Java is used to print the specified Object on the stream. This Object is taken as a parameter. Syntax: public void print(Object object) Parameters: This method accepts a mandatory parameter object which is the Object to be printed in the Stream. Return Value: This method do not returns any value. Below methods illustrates the working of print(Object) method: Program 1: Java // Java program to demonstrate // PrintStream print(Object) method import java.io.*; class GFG { public static void main(String[] args) { try { // Create a PrintStream instance PrintStream stream = new PrintStream(System.out); // Get the char[] object // to be printed in the stream char[] object = { 'G', 'e', 'e', 'k', 's', 'F', 'o', 'r', 'G', 'e', 'e', 'k', 's' }; // print the object // to this stream using print() method // This will put the object in the stream // till it is printed on the console stream.print(object); stream.flush(); } catch (Exception e) { System.out.println(e); } } } Output: GeeksForGeeks Program 2: Java // Java program to demonstrate // PrintStream print(Object) method import java.io.*; class GFG { public static void main(String[] args) { try { // Create a PrintStream instance PrintStream stream = new PrintStream(System.out); // Get the String Object // to be printed in the stream String object = "GFG"; // print the object // to this stream using print() method // This will put the object in the stream // till it is printed on the console stream.print(object); stream.flush(); } catch (Exception e) { System.out.println(e); } } } Output: GFG Comment More infoAdvertise with us Next Article PrintStream print(Object) method in Java with Examples K Kirti_Mangal Follow Improve Article Tags : Java Java-Functions Java-IO package Java-PrintStream Practice Tags : Java Similar Reads PrintStream println(Object) method in Java with Examples The println(Object) method of PrintStream Class in Java is used to print the specified Object on the stream and then break the line. This Object is taken as a parameter. Syntax: public void println(Object object) Parameters: This method accepts a mandatory parameter object which is the Object to be 2 min read PrintStream printf(String, Object) method in Java with Examples The printf(String, Object) method of PrintStream Class in Java is used to print a formatted string in the stream. The string is formatted using specified format and arguments passed as the parameter. Syntax: public PrintStream printf(String format, Object...args) Parameters: This method accepts two 2 min read PrintWriter print(Object) method in Java with Examples The print(Object) method of PrintWriter Class in Java is used to print the specified Object on the stream. This Object is taken as a parameter. Syntax: public void print(Object object) Parameters: This method accepts a mandatory parameter object which is the Object to be printed in the Stream. Retur 2 min read PrintWriter println(Object) method in Java with Examples The println(Object) method of PrintWriter Class in Java is used to print the specified Object on the stream and then break the line. This Object is taken as a parameter. Syntax: public void println(Object object) Parameters: This method accepts a mandatory parameter object which is the Object to be 2 min read PrintStream println() method in Java with Examples The println() method of PrintStream Class in Java is used to break the line in the stream. This method do not accepts any parameter or return any value. Syntax: public void println() Parameters: This method do not accepts any parameter. Return : This method do not returns any value. Below methods il 2 min read Like