JAVA Notes
JAVA Notes
12. Which of the following lists can contain the same element multiple times?
a) Set
b) Map
c) List
d) None of the above
13. Which method is used to obtain the size of a collection?
a) length()
b) getLength()
c) count()
d) size()
14. Which of the following is ordered and sorted by its natural ordering or by a
comparator?
a) HashSet
b) LinkedHashSet
c) TreeSet
d) List
26. What is the name of the thread in the following Java Program
a) main
b) Thread
c) System
d) None of the mentioned
27. Which of the following will ensure the thread will be in running state?
a) yield()
b) notify()
c) wait()
d) Thread.killThread()
9. Which of the following methods are needed for loading a database driver
inJDBC?
A. registerDriver() method
B. Class.forName()
C. Both A and B
D. getConnection()
10. Which one is the correct order of phases in JSP life cycle?
a) Initialization, Cleanup, Compilation, Execution
b) Initialization, Compilation, Cleanup, Execution
c) Compilation, Initialization, Execution, Cleanup
d) Cleanup, Compilation, Initialization, Execution
20. How many jsp implicit objects are there and these objects are created by
the web container that are available to all the jsp pages?
a) 8
b) 9
c) 10
d) 7
21. Which is not a directive?
a)include
b)page
c)export
d)taglib
4. Which scope in Spring ensures that object exists between every request in
an HTTP session?
(a) Singleton
(b) Prototype
(c) Request
(d) Session
5. What is Hibernate?
a) A programming language
b) A database management system
c) An object-relational mapping (ORM) framework
d) A scripting language