☑ MCQ PRACTICE

Java Programming Part 4

Practice objective questions for quick revision and examination preparation. Try answering each question before revealing the answer.

📚 Java Programming
📖 Part 4
🎯 MCQs

Java Programming - Part-4

1
Which of these interface declares core method that all collections will have?
Aset
BEventListner
CComparator
DCollection
Correct Answer Collection
2
Which of these interface handle sequences?
ASet
BList
CComparator
DCollection
Correct Answer List
3
Which of this interface must contain a unique element?
ASet
BList
CArray
DCollection
Correct Answer Set
4
Which of these is a Basic interface that all other interface inherits?
ASet
BArray
CList
DCollection
Correct Answer Collection
5
Which of these is static variable defined in Collections?
AEMPTY_SET
BEMPTY_LIST
CEMPTY_MAP
DAll of the mentioned
Correct Answer All of the mentioned
6
Which of these packages contain all the collection classes?
Ajava.lang
Bjava.util
Cjava.net
Djava.awt
Correct Answer java.util
7
Which of these classes is not part of Java’s collection framework?
AMaps
BArray
CStack
DQueue
Correct Answer Maps
8
Which of this interface is not a part of Java’s collection framework?
AList
BSet
CSortedMap
DSortedList
Correct Answer SortedList
9
Which of these methods deletes all the elements from invoking collection?
Aclear()
Breset()
Cdelete()
Drefresh()
Correct Answer clear()
10
What is Collection in Java?
AA group of objects
BA group of classes
CA group of interfaces
DNone of the mentioned
Correct Answer A group of objects
11
Which of these classes is not part of Java’s collection framework?
AMaps
BArray
CStack
DQueue
Correct Answer Queue
12
Which of these methods deletes all the elements from invoking collection?
Aclear()
Breset()
Cdelete()
Drefresh()
Correct Answer clear()
13
The collection
Aextends Collections class
Bextends Iterable interface
Cimplements Serializable interface
Dimplements Traversable interface
Correct Answer extends Iterable interface
14
Which of these interfaces declares core method that all collections will have?
Aset
BEventListner
CComparator
DCollection
Correct Answer Collection
15
Which of these interfaces handle sequences?
ASet
BList
CComparator
DCollection
Correct Answer List
16
Which of these interface is not a part of Java’s collection framework?
AList
BSet
CSortedMap
DSortedList
Correct Answer SortedList
17
Which of these interface must contain a unique element?
ASet
BList
CArray
DCollection
Correct Answer Set
18
Which of these is Basic interface that all other interface inherits?
ASet
BArray
CList
DCollection
Correct Answer Collection
19
Which of these is an incorrect form of using method max() to obtain maximum element?
Amax(Collection c)
Bmax(Collection c, Comparator comp)
Cmax(Comparator comp)
Dmax(List c)
Correct Answer max(Comparator comp)
20
Which of these methods sets every element of a List to a specified object?
Aset()
Bfill()
CComplete()
Dadd()
Correct Answer fill()
21
Which of these methods can randomize all elements in a list?
Arand()
Brandomize()
Cshuffle()
Dambigous()
Correct Answer shuffle()
22
Which of these methods can convert an object into a List?
ASetList()
BConvertList()
CsingletonList()
DCopyList()
Correct Answer singletonList()
23
Which of these is true about unmodifiableCollection() method?
AunmodifiableCollection() returns a collection that cannot be modified
BunmodifiableCollection() method is available only for List and Set.
CunmodifiableCollection() is defined in Collection class.
DNone of the mentioned
Correct Answer unmodifiableCollection() method is available only for List and Set.
24
Which of these is static variable defined in Collections?
AEMPTY_SET
BEMPTY_LIST
CEMPTY_MAP
DAll of the mentioned
Correct Answer All of the mentioned
25
Which of these standard collection classes implements a dynamic array?
AAbstractList
BLinkedList
CArrayList
DAbstractSet
Correct Answer ArrayList
26
Which of these class can generate an array which can increase and decrease in size automatically?
AArrayList()
BDynamicList()
CLinkedList()
DDynamicList()
Correct Answer ArrayList()
27
Which of these method can be used to increase the capacity of ArrayList object manually?
ACapacity()
BincreaseCapacity()
Cincreasecapacity()
DensureCapacity()
Correct Answer ensureCapacity()
28
Which of these method of ArrayList class is used to obtain present size of an object?
Asize()
Blength()
Cindex()
Dcapacity()
Correct Answer size()
29
Which of these methods can be used to obtain a static array from an ArrayList object?
AArray()
BcovertArray()
CtoArray()
DcovertoArray()
Correct Answer Array()
30
Which of these method is used to change an element in a LinkedList Object?
Achange()
Bset()
Credo()
Dadd()
Correct Answer set()
← Back to All MCQs