Let us create a program that will use the functions of PrintWriter class to print data on the Terminal Window.

import java.io.*;
public class UsingPrintWriter
{
    public static void main(String args[])
	{
	    PrintWriter objs=new PrintWriter(System.out,true);
		objs.printIn("Using PrintWriter Class");
		objs.printIn("***********************");
		objs.printIn(" I Love my ");
		objs.printIn(" India ");
		objs.printIn("***********************");
	}
}
		
Show Buttons
Hide Buttons