R4RIN
Articles
Java 8
MCQS
Java MCQ Quiz Hub
Java Mcq Question Set 4
Choose a topic to test your knowledge and improve your Java skills
1. Which of these keywords must be used to handle the exception thrown by try block in some rational manner?
catch
throw
finally
try
2. Which of these keywords is used to manually throw an exception?
catch
try
throw
finally
3. Which of these is a super class of all exceptional type classes?
Cachable
String
RuntimeExceptions
Throwable
4. Which of these class is related to all the exceptions that can be caught by using catch?
Exception
Error
RuntimeExecption
All of the above
5. Which of these class is related to all the exceptions that cannot be caught?
RuntimeExecption
Exception
Error
All of the above
6. Which of these handles the exception when no catch is used?
Default handler
throw handler
Java run time system
finally
7. Which of these keywords is used to generate an exception explicitly?
finally
catch
throw
try
8. Which of these class is related to all the exceptions that are explicitly thrown?
Exception
Error
Throw
Throwable
9. Which of these operator is used to generate an instance of an exception than can be thrown by using throw?
thrown
new
malloc
alloc
10. Which of these keywords is used to by the calling function to guard against the exception that is thrown by called function?
throw
try
catch
throws
11. Which of these keywords is used to define interfaces in Java?
interface
intf
Interface
Intf
12. Which of these can be used to fully abstract a class from its implementation?
Objects
Packages
Interfaces
None
13. Which of these access specifiers can be used for an interface?
private
Public
Protected
All of the above
14. Which of these keywords is used by a class to use an interface defined previously?
Import
implements
Implements
import
15. Which of the following is correct way of implementing an interface salary by class manager?
class manager imports salary {}
class manager extends salary {}
class manager implements salary {}
None
16. Which of the following is incorrect statement about packages?
Interfaces are specified public if they are to be accessed by any code in the program.
All variables in interface are implicitly final and static.
Interfaces specifies what class must do but not how it does.
All variables are static and methods are public if interface is defined pubic.
17. Which of the following package stores all the standard java classes?
java
lang
util
java.packages
18. Which of these classes is not included in java.lang?
Integer
Array
Class
Byte
19. Which of these is a process of converting a simple data type into a class?
type casting
type wrapping
type conversion
None
20. Which of these is a super class of wrappers Double & Integer?
Number
Float
Long
Digits
Submit