Card 73 / 76: Both the getMessage and toString methods return information about exceptions that are caught. Which method returns the basic information as well as the class name of the exception?
A)
getMessage()
B)
toString()
C)
getData()
D)
toOutput()
Answer:
B) toString()
Previous Card | ← Previous Card Button |
Next Card | → Next Card Button |
Flip Card | Space-Bar |
A, C and D are incorrect.
A is incorrect because the getMessage method returns only the basic information of an exception being caught, not the class name—for example, “… (The filename, directory name, or volume label syntax is incorrect)”.
C is incorrect because there is no getData method.
D is incorrect because there is no toOuput method.
|