Java Collections and GUI (GATE)
Collection Framework Questions
Questions
How many constructors are there of ArrayList class in Java?
- 6
- 5
- 4
- 3
- 2
How many constructors are there of Vector class in Java collection framework?
- 6
- 5
- 4
- 3
- 2
Which of the following methods is present in ListIterator interface in Java collections?
- nextIndex()
- addAll()
- IndexOf()
- listIterator()
- subList(startindex,endindex)
Which of the following methods is present in the Stack class in Java collections framework?
- remove()
- element()
- Pop()
- poll()
- exit()
Which of the following methods are present in the queue interface?
- poll()
- search(o:Object)
- empty()
- exit()
- Pop()
Which of the following methods is present in LinkedList class in Java collections?
- addFirst()
- setFirst()
- setLast()
- indexOf(e:Element)
- lastIndexOf(e:element)
Which of the following methods is/are static in collections class?
- Frequency(c : collection, o : object)
- Reverse(List)
- Sort(List)
- Both 1 and 2
- All of the above
Which of the following methods in collections class is not static?
- Min(c:Collection)
- Shuffle(list)
- Frequency(c :collection, o :object)
- Copy(destination,source)
- Merge(c:collection,c1:collection)
Which of the following methods is not present in Vector class in Java collections framework?
- elementAt(index)
- firstElement()
- removeElementAt(int)
- setSize(int)
- removeFirst()
What is the third argument passed to the Constructor of GridLayout?
- Int rows
- Int columns
- Int HorizontalGap
- Int VerticalGap
- Int Alignmnent
What is the second argument passed to the constructor of GridLayout?
- Int rows
- Int columns
- Int horizontalGap
- Int VerticalGap
- Int Alignment
What is the initial capacity of Vector?
- 16
- 10
- 20
- 12
- 18
Which of the following methods is present in Vector class in Java collections framework?
- removeAllElements()
- element()
- removeLast()
- get(index : int)
- set(index,element)
What is the third argument passed to the Constructor of BorderLayout?
- Int alignment
- Int horizontalGap
- Int VerticalGap
- Int Rows
- None of these
Which of the following arguments is the third argument passed to the constructor of the FlowLayout?
- Int horizontalGap
- Int VerticalGap
- Int Alignment
- Int Rows
- Int Columns