Sail E0 Webinar

MCQs

Total Questions : 45 | Page 1 of 5 pages
Question 1. 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 2. Which of these method of Array class is used sort an array or its subset?
  1.    binarysort()
  2.    bubblesort()
  3.    sort()
  4.    insert()
 Discuss Question
Answer: Option C. -> sort()


sort()


Question 3. Which of these methods can be used to search an element in a list?
  1.    find()
  2.    sort()
  3.    get()
  4.    binaryserach()
 Discuss Question
Answer: Option D. -> binaryserach()


binaryserach() method uses binary search to find a specified value. This method must be applied to sorted arrays.


Question 4. Which of these standard collection classes implements all the standard functions on list data structure?
  1.    Array
  2.    LinkedList
  3.    HashSet
  4.    AbstractSet
 Discuss Question
Answer: Option A. -> Array


Array


Question 5. Which of these method is used to change an element in a LinkedList Object?
  1.    change()
  2.    set()
  3.    redo()
  4.    add()
 Discuss Question
Answer: Option C. -> redo()


An element in a LinkedList object can be changed by first using get() to obtain the index or location of that object and the passing that location to method set() along with its new value.


Question 6. Which of these class object has architecture similar to that of array?
  1.    Bitset
  2.    Map
  3.    Hashtable
  4.    All if the mentioned
 Discuss Question
Answer: Option A. -> Bitset


Bitset class creates a special type of array that holds bit values. This array can increase in size as needed.


Question 7. Which of these methods is used to retrieve elements in BitSet object at specific location?
  1.    get()
  2.    Elementat()
  3.    ElementAt()
  4.    getProperty()
 Discuss Question
Answer: Option A. -> get()


get()


Question 8. 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()


length()


Question 9. Which of these method is used to make a bit zero specified by the index?
  1.    put()
  2.    set()
  3.    remove()
  4.    clear()
 Discuss Question
Answer: Option D. -> clear()


clear()


Question 10. Which of these is a method of class Date which is used to search weather object contains a date before the specified date?
  1.    after()
  2.    contains()
  3.    before()
  4.    compareTo()
 Discuss Question
Answer: Option C. -> before()


before() returns true if the invoking Date object contains a date that is earlier than one specified by date, otherwise it returns false.


Latest Videos

Latest Test Papers