Sail E0 Webinar

MCQs

Total Questions : 105 | Page 8 of 11 pages
Question 71.

Which of these method is a rounding function of Math class?


  1.    max()
  2.    min()
  3.    abs()
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned

max(), min() and abs() are all rounding functions.


Question 72.

Which of these method of HashSet class is used to add elements to its object?


  1.    add()
  2.    Add()
  3.    addFirst()
  4.    insert()
 Discuss Question
Answer: Option A. -> add()

None.


Question 73.

Which of these method Map class is used to obtain an element in the map 

having specified key?


  1.    search()
  2.    get()
  3.    set()
  4.    look()
 Discuss Question
Answer: Option A. -> search()

None.


Question 74.

Which of the following statements are incorrect?


  1.    static methods can call other static methods only.
  2.    static methods must only access static data.
  3.    static methods must only access static data.
  4.    when object of class is declared, each object contains its own copy of static variables.
 Discuss Question
Answer: Option D. -> when object of class is declared, each object contains its own copy of static variables.

All objects of class share same static variable, when object of a class are declared, all the objects 

share same copy of static members, no copy of static variables are made.


Question 75.

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()

None.


Question 76.

Which of these method can be used to increase the capacity of ArrayList object manually?


  1.    Capacity()
  2.    increaseCapacity()
  3.    increasecapacity()
  4.    ensureCapacity()
 Discuss Question
Answer: Option D. -> ensureCapacity()

When we add an element, the capacity of ArrayList object increases automatically, but 

we can increase it manually to specified length x by using function ensureCapacity(x);


Question 77.

Which of these is a class which uses String as a key to store the value in object?


  1.    Array
  2.    ArrayList
  3.    Dictionary
  4.    Properties
 Discuss Question
Answer: Option D. -> Properties

 None.


Question 78.

What is the name of data member of class Vector which is used to store number of 

elements in the vector?


  1.    length
  2.    elements
  3.    elementCount
  4.    capacity
 Discuss Question
Answer: Option C. -> elementCount

None.


Question 79.

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.


Question 80.

Which of these cannot be declared static?


  1.    class
  2.    object
  3.    variable
  4.    method
 Discuss Question
Answer: Option B. -> object

static statements are run as soon as class containing then is loaded, prior to any object declaration.


Latest Videos

Latest Test Papers