Professional Documents
Culture Documents
QUESTION 1:
Which of the following is/are FALSE in the case of Data Structure in Java?
Detailed Solution:
Option b is wrong. A linked list is a linear data structure.
The correct statement will be: Linked List is a sequential linear data structure.
All other options are correct.
● Array, linked list, stack, and queue are linear data structures.
● Array is an indexed data structure.
● Linked list is a sequential data structure.
● Set, tress, table, and graph are non-linear data structures.
For more details, refer to slide #6 from week 2, titled Differential data structure.
____________________________________________________________________________
QUESTION 2:
Which of the following is True in the case of Java Collection Framework(JCF)?
Correct Answer: C
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Detailed Solution:
Only option C is true; all other options are false.
The correct statements will be as follows:
● JCF provides high-performance software encoding
● Extending and /or adapting a collection is easy and flexible
● The JCF consists of : Collections under Collection and Facilities under Map(from slide)
● JCF allows different types of collections to work with a high degree of interoperability
QUESTION 3:
Which among the following is a Java Collection Framework(JCF) Class?
a. Set
b. List
c. Queue
d. Vector
Correct Answer: d
Detailed Solution:
The entire Java Collection Framework (JCF) is built upon a set of standard interfaces, classes, and
algorithms.
● Interfaces: Set, List, Queue, Deque
● Classes: Array List, Vector, LinkedList, PriorityQueue, HashSet, Linked HashSet,
TreeSet
As Vector lies under JCF classes, hence d is the correct answer here.
QUESTION 4:
Choose the right option to complete the following sentence in the case of EnumSet
a. Enum type
b. Enum
c. AbstractSet
d. Set
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Correct Answer: d
Detailed Solution:
EnumSet extends AbstractSet and implement Set.
Refer to slide #83 titled ‘Class EnumSet’.
QUESTION 5:
Which of the following statement is incorrect with respect to ‘Map’ in Java?
Correct Answer: d
Detailed Solution:
All are true except option d.
SortedMap interface extends Map
QUESTION 6:
Which of the following statements is/are incorrect for Java Collection Framework (JCF)?
Correct Answer: C
Detailed Solution:
Statement C is incorrect ther correct statement will be
“Like Hashmap, hashtable also stores Key/Value pairs.”
QUESTION 7:
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
a. A concrete implementation
b. An interface
c. An abstract class
d. A data structure for storing only integers
Correct Answer: c
Detailed Solution:
In the Java Collection Framework (JCF), a Dictionary is an abstract class. The Dictionary class
was part of the original collection classes introduced in Java, which served as the basis for the
modern Map interface. It maps keys to values, but it is now considered obsolete and has been
replaced by the Map interface.
QUESTION 8:
Which of the following interface(s) is (are) NOT descendant(s) of java.util.Collection?
a. java.util.SortedMap
b. java.util.Set
c. java.util.SortedSet
d. java.util.Queue
Correct Answer: a
Detailed Solution:
java.util.SortedMap is a descendant of java.util.Map
QUESTION 9:
Which of the following declaration(s) is(are) not correct to instantiate a collection object?
a. List <data-type> list1= new ArrayList();
b. List <data-type> list2 = new LinkedList();
c. List <data-type> list3 = new Vector();
d. List <data-type> list4 = new PriorityQueue() ;
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Correct Answer: d
Detailed Solution:
Option(d):
Queue<String> q1 = new PriorityQueue();
QUESTION 10:
Which of these interface handle sequences?
a. Set
b. Array
c. List
d. Collection
Correct Answer: c
Detailed Solution:
List interface handles sequences.
************END************