Sail E0 Webinar

MCQs

Total Questions : 105 | Page 9 of 11 pages
Question 81.

Which of these method is used to remove all keys/values pair from the invoking

 map?


  1.    delete()
  2.    remove()
  3.    clear()
  4.    removeAll()
 Discuss Question
Answer: Option B. -> remove()

None.


Question 82.

Which of these method is used to add an element to the start of a LinkedList object?


  1.    add()
  2.    first()
  3.    AddFirst()
  4.    addFirst()
 Discuss Question
Answer: Option D. -> addFirst()

None.


Question 83.

Which of these method is used to make all elements of an equal to specified value?


  1.    add()
  2.    fill()
  3.    all()
  4.    set()
 Discuss Question
Answer: Option B. -> fill()

fill() method assigns a value to all the elements in an array, in other words it fills the 

array with specified value.


Question 84.

What is the value of double constant 'E' defined in Math class?


  1.    approximately 3
  2.    approximately 3.14
  3.    approximately 2.72
  4.    approximately 0
 Discuss Question
Answer: Option C. -> approximately 2.72

None.


Question 85.

Which of these is the interface of legacy?


  1.    Map
  2.    Enumeration
  3.    HashMap
  4.    Hashtable
 Discuss Question
Answer: Option B. -> Enumeration

None.


Question 86.

Which of these method is used to calculate number of bits required to hold 

the BitSet object?


  1.    size()
  2.    length()
  3.    indexes()
  4.    numberofBits()
 Discuss Question
Answer: Option B. -> length()

None.


Question 87.

Which of these keywords is used to prevent content of a variable from being modified?


  1.    final
  2.    last
  3.    constant
  4.    static
 Discuss Question
Answer: Option A. -> final

A variable can be declared final, doing so prevents its content from being modified. Final variables 

must be initialized when it is declared.


Question 88.

Which of these is the interface of legacy is implemented by Hashtable and Dictionary 

classes?


  1.    Map
  2.    Enumeration
  3.    HashMap
  4.    Hashtable
 Discuss Question
Answer: Option A. -> Map

Dictionary, Map & Hashtable all implement Map interface hence all of them uses keys 

to store value in the object.


Question 89.

Which of these class can generate an array which can increase and decrease in size 

automatically?


  1.    ArrayList()
  2.    DynamicList()
  3.    LinkedList()
  4.    DynamicList()
 Discuss Question
Answer: Option A. -> ArrayList()

None.


Question 90.

Which of these classes implements Set interface?


  1.    ArrayList
  2.    HashSet
  3.    LinkedList
  4.    DynamicList
 Discuss Question
Answer: Option B. -> HashSet

HashSet and TreeSet implements Set interface where as LinkedList and ArrayList 

implements List interface.


Latest Videos

Latest Test Papers