IllegalStateException is thrown when java environment or Java application is not in an appropriate state for the requested operation. Option D is incorrect since the ExceptionInInitializerError is thrown to indicate that an exception occurred during evaluation of a static initializer or the initializer for a static variable. Option A is incorrect since the ClassCastException is thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance. Integer.parseInt can throw a NumberFormatException, and IllegalArgumentException is its superclass (i.e., a broader exception), so we can use it here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |