Friday, January 15, 2010

Unit-3
I. Each Question Carries 1 Mark.

1) All exception types are subclasses of _______?
a) Throw able b) Exception c) Runtime Exception d)None

2) To Guard against and handle a runtime error , simply enclose the code in___block
a) Try b)Catch c) Finally d)None

3) A Try block has to be followed by________?
a) Catch or Finally b) Finally c) Catch d) None

4) A division by Zero generate______Exception?
a) Arithmetic b) Runtime c) Error d) None

5) Throw able overrides ____method so that it can return a string containing a description of the exceptions?
a) to String() b) Append c) Super d) None

6) Can we Specify two or more catch clauses , each catching a different exception?
a)Yes b) No

7) Is it possible have nested try blocks ?
a) Yes b) No

8) Throw can only throw ?
a) Throw able Instance b) Any Object c) Any Class d) none

9) throw clause are restricted for ___
a) Error or Runtime Exception b) Only Error c) Only Runtime Exception d) Error

10) Which block will be executed whether or not an exception is thrown?
a) Finally b) Catch c) Try Catch d) None

11) An exception is an ____________.
a) object b) event c) error d) Both b, c

12) Creating an exception object and handling it to the runtime system is called throwing an exception.
a) False b) True

13) Exceptions in java are actual objects, they instances of classes that inherit from the class is called ___________.
a) Exception b) IO Exception c) Throw able d) None

14) Throw able is an sub class of object , it contains two sub classes.
a) True b) False

15) Runtime exceptions can occur any where in program and typical program can be very numerous.
a) True b) False

16) Exceptions are two types such as exception, error
a) False b) True

17) Typically the statements with in the finally clause do clean up process such as releasing resources, closing file etc.
a) True b) False

18) An alternative way is to indicate that a method may possibly throw an exception. This is done by ___________.
a) Throw b) throws c) try d) None



I. Answer – 1 Mark.

1. B 2. A 4. A 5. A 6. A 7. A 8. A
9. B 10. C 11. A 12. D 13. B 14.C 15. A
16. A 17. B 18. A