In object oriented programming, the statement PrintWriter output=new PrintWriter(outfile); creates an object of the class PrintWriter this object is the reference variable called output. and it is assigned the string variable outfile. The object output can then be used to access other methods and fields of the class PrintWriter using the dot notation (or operator)