JavaSE Mock Exam - 3
Comprehensive MCQ Collection | Java SE Certification Preparation
1. Which of these keywords must be used to handle the exception thrown by try
block in some rational manner?
A. try
B. finally
C. throw
D. catch
Correct Answer: D. catch
2. Which of these handles the exception when no catch is used?
A. Default handler
B. finally
C. throw handler
D. Java run time system
Correct Answer: A. Default handler
3. Which of these method of String class is used to obtain character at specified
index?
A. char()
B. Charat()
C. charat()
D. charAt()
Correct Answer: D. charAt()
4. Which of these method of String class can be used to test to strings for
equality?
A. isequal()
B. isequals()
C. equal()
D. equals()
Correct Answer: D. equals()
5. Which of these are legacy classes?
A. Stack
B. Hashtable
C. Vector
D. All of the mentioned
Correct Answer: D. All of the mentioned
6. Which of these method is used to insert value and its key?
A. put()
B. set()
C. insertElement()
D. addElement()
Correct Answer: A. put()
7. Which is a reserved word in the Java programming language?
A. method
B. native
C. subclasses
D. reference
Correct Answer: B. native
8. Which of these classes implements Set interface?
A. ArrayList
B. HashSet
C. LinkedList
D. DynamicList
Correct Answer: B. HashSet
9. Which of these method Map class is used to obtain an element in the map
having specified key?
A. search()
B. get()
C. set()
D. look()
Correct Answer: A. search()
10. Which of these methods can be used to obtain set of all keys in a map?
A. getAll()
B. getKeys()
C. keyall()
D. keySet()
Correct Answer: D. keySet()
11. Which of these interface is not a part of Java’s collection framework?
A. List
B. Set
C. SortedMap
D. SortedList
Correct Answer: D. SortedList
12. Which of these are types of multitasking?
A. Process based multitasking
B. Thread based multitasking
C. Both Option A & B
D. None of the mentioned
Correct Answer: D. None of the mentioned
13. Which of these interfaces is implemented by Thread class?
A. Runnable
B. Connections
C. Set
D. MapConnections
Correct Answer: A. Runnable
14. Which of these class have only one field ‘TYPE’?
A. Void
B. Process
C. System
D. Runtime
Correct Answer: A. Void
15. Which of these class can encapsulate an entire executing program?
A. Void
B. Process
C. Runtime
D. System
Correct Answer: B. Process
16. Which of these is correct way of calling a constructor having no parameters,
of superclass A by subclass B?
A. super(void);
B. superclass.();
C. super.A();
D. super();
Correct Answer: D. super();
17. Which of these methods return a class object given its name?
A. getClass()
B. findClass()
C. getSystemClass()
D. findSystemClass()
Correct Answer: D. findSystemClass()
18. Which of these functions is called to display the output of an applet?
A. display()
B. print()
C. displayApplet()
D. PrintApplet()
Correct Answer: B. print()
19. Which of these cannot be declared static?
A. class
B. object
C. variable
D. method
Correct Answer: B. object
20. Which of these is wrapper for simple data type char?
A. Float
B. Character
C. String
D. Both Option B & C
Correct Answer: B. Character
21. Which of these is an abstract class?
A. Thread
B. Runnable
C. Multithread
D. System
Correct Answer: A. Thread
22. Which of these is a mechanism for naming and visibility control of a class
and its content?
A. Object
B. Packages
C. Interfaces
D. None of the Mentioned
Correct Answer: B. Packages
23. Which of these access specifiers can be used for an interface?
A. Public
B. Protected
C. private
D. All of the mentioned
Correct Answer: A. Public
24. Package of drawstring() method is:
A. [Link]
B. [Link]
C. [Link]
D. [Link]
Correct Answer: D. [Link]
25. Which method is called first by an applet?
A. start()
B. run()
C. init()
D. paint()
Correct Answer: C. init()
26. Which of these methods can be used to output a string in an applet?
A. display()
B. print()
C. drawString()
D. transient()
Correct Answer: C. drawString()
27. Super is the predefined:
A. Keyword
B. Method
C. Keyword and Method
D. None of above
Correct Answer: C. Keyword and Method
28. Which of these is a protocol for breaking and sending packets to an address
across a network?
A. TCIP/IP
B. DNS
C. Socket
D. Proxy Server
Correct Answer: A. TCIP/IP
29. Which of these class is used to create servers that listen for either local or
remote client programs?
A. httpServer
B. ServerSockets
C. MimeHeader
D. HttpResponse
Correct Answer: B. ServerSockets
30. Which of these method of httpd class is used to get report on each hit to
HTTP server?
A. log()
B. logEntry()
C. logHttpd()
D. logResponse()
Correct Answer: B. logEntry()