Ask Question
20 September, 06:19

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. 20 September, 07:39
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers