Presentation is loading. Please wait.

Presentation is loading. Please wait.

Question 1 What can happen if you don’t close a File Stream when you are done with it? A)Nothing will happen since it will always close on its own B)The.

Similar presentations


Presentation on theme: "Question 1 What can happen if you don’t close a File Stream when you are done with it? A)Nothing will happen since it will always close on its own B)The."— Presentation transcript:

1 Question 1 What can happen if you don’t close a File Stream when you are done with it? A)Nothing will happen since it will always close on its own B)The file won’t be readable because the file will never be closed C)The file may have corrupt data inside the file. D)The file will never save what was written to it.

2 Question 2 Which of the following is true? A)The order of data written in a DataOutputStream and read in a DataInputStreamto the file isnt important; The program will know where to get the data we wrote. B)The Order only matters as long as we use the correct variable types. C)There is no reason to use FileInputStreams or FileOutputStreams except to attach higher level streams to them. D)Our program needs the right order to retrieve the correct variables.

3 Question 3 Which is the correct way to initialize the objects to use a DataInputStream? A) Create the DataInput Stream object, then attach it to a new FileInputStream object, then finally create a File object and connect them together. B)Create a File Object, then Create a DataInputStream Object and connect it directly to the File Object. C) Create a FileInputStream object, then create a DataInputStream object to connect to the FileInputStream object. We don’t need a File object because the FileInputStream object can write directly to a file. D) Create a File object. Then create FileInputStream object with the File object. After that create a DataInputStream object using the FileInputStream object.

4 Question 4 What is a correct difference between a text and binary file type? A)You can’t store text inside a binary file. B)Binary files can’t be used on windows. C)Text file is more efficient to use than a Binary file D) Binary objects can sometimes depend on the machine (operating system, program)

5 Question 5 Which of the following is not a valid way to take input from a file? A)Use a BufferedReader B)Use a Scanner C)Use a DataInputStream D)Use a BinaryInputStream E)Use a FileInputStream


Download ppt "Question 1 What can happen if you don’t close a File Stream when you are done with it? A)Nothing will happen since it will always close on its own B)The."

Similar presentations


Ads by Google