HOTSPOT You have the following code (line numbers are included for reference only):
To answer, complete each statement according to the information presented in the code.
Answer:
3 Comments on “complete each statement according to the information presented in the code.”
PaulCsays:
FileNotFoundException
the Console.txt file
0
0
Adamsays:
Console.txt? Your read from this file, but final output is Debug console.
0
0
don't test mesays:
new StreamWriter(@”C:\console.txt”). So you’re writing to console.txt
using (FileStream stream = new FileStream(@”C:\file.txt”, FileMode.Open))
{
using (StreamReader reader = new StreamReader(stream))
So you are reading from file.txt
Since you seat the output stream of the console to be the ‘writer’ streamwriter, you’re essentially writing the console output to the console.txt file. so the output would be the content of the console which is written in the console.txt file by the writer streamwriter, therefore the console.txt file is the final output.
FileNotFoundException
the Console.txt file
0
0
Console.txt? Your read from this file, but final output is Debug console.
0
0
new StreamWriter(@”C:\console.txt”). So you’re writing to console.txt
using (FileStream stream = new FileStream(@”C:\file.txt”, FileMode.Open))
{
using (StreamReader reader = new StreamReader(stream))
So you are reading from file.txt
Since you seat the output stream of the console to be the ‘writer’ streamwriter, you’re essentially writing the console output to the console.txt file. so the output would be the content of the console which is written in the console.txt file by the writer streamwriter, therefore the console.txt file is the final output.
0
0