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

16. State whether the following exceptions are checked or unchecked exceptions.

ID: 3715447 • Letter: 1

Question

16. State whether the following exceptions are checked or unchecked exceptions. (Hint: You will need to know the inheritance hierarchy of each of these exception classes: its superclass, its superclass’s superclass, etc. This can be found near the top of the Javadoc documentation for each
class. Google should return the Javadoc of the class as the first result when you search for java 9 javadoc className, replacing className with the exception’s name.)
java.lang.ArithmeticException java.lang.ClassNotFoundException java.io.IOException java.lang.NumberFormatException java.sql.SQLException (10 points)
17. Which class contains the format method for writing to a text file?
18. Which class can be used to retrieve Strings, numeric primitives, or full lines of text from a text file?
19. Which interface must a class implement in order for its objects to be serialized?
20. Which class contains the writeObject method for serializing an object?
21. Which class contains the readObject method for deserializing an object?

Explanation / Answer

16) unchecked Exceptions, this is because the will occur at runtime.

17) Writer is the abstract class for writing character streams to a text file.

There are three types of implemented classes of this writer class.

1.FileOutputStream
2.OutputStreamWriter
3.BufferedWriter


18 import java.util.Scanner , BufferedReader class can be used to retrieve Strings, numeric primitives, or full lines of text from a text file.

19. The class must implement the java.io.Serializable interface.


20.The ObjectOutputStream class contains the writeObject method for serializing an object.

21.The ObjectInputStream class contains the readObject method for serializing an object.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote