Ask Question
18 August, 17:06

Given an initialized String variable outfile, write a statement that declares a PrintWriter reference variable named output and initializes it to a reference to a newly created PrintWriter object associated with a file whose name is given by outfile.

+3
Answers (1)
  1. 18 August, 17:22
    0
    PrintWriter output=new PrintWriter (outfile);

    Explanation:

    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)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Given an initialized String variable outfile, write a statement that declares a PrintWriter reference variable named output and initializes ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers