Ask Question
1 March, 18:35

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.

+2
Answers (1)
  1. 1 March, 21:20
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers