Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

JAVA multiple choice: QUESTION 13 The exception classes are in packages in the _

ID: 3885550 • Letter: J

Question

JAVA multiple choice:

QUESTION 13

The exception classes are in packages in the ________.

a.)Compiler b.)JVM c.)Java API d.)Ex class

QUESTION 14

The IllegalArgumentException class extends the RuntimeException class, and is therefore:

a.) a checked exception class b.) an unchecked exception class c.) never used directly d.) None of these

QUESTION 15 If you want to append data to the existing binary file, BinaryFile.dat, use the following statements to open the file FileOutputStream fstream = DataOutputStream binaryOutputFile = FileOutputStream fstream = DataOutputStream binaryOutputFile = FileOutputStream fstream = DataOutputStream binaryOutputFile = FileOutputStream fstream = DataOutputStream binaryOutputFile = neu FileOutputStream("BinaryFile.dat", true); new DataOut putStream(fstream) new FileOutputStream("BinaryFile.dat", false) new DataOut putStream(fstream) neu FileOutputStream("BinaryFile.dat" new DataOutputStreamifstream, true): neu FileOutputStream("BinaryFile.dat" new DataOutputstream (fstream)

Explanation / Answer

13. The JRE usually holds all the packages and JVM together. Based on the options, we can say Compiler. Answer (a)

14. Every class that is a child of Runtime Exception and Error classes are Unchecked exception classes. Answer (b)

15. option (1)

FileOuptutStream fstream = new FileOutputStream("BinaryFile.dat", true); // the second parameter is to indicate whether the file will be opened in appending mode or not. True means append mode, false means overwrite mode.

DataOutputStream binaryOutputFile = new DataOutputStream(fstream);