Log In Register

Units


Java.util Library - Questions and Answers

 

Practice these Java.util Library under Java Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Java.util Library for following purpose.


– Anyone who is wishing to increase their perfect knowledge of Java.util Library of Java Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge Java Programming specifically Java.util Library.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Java.util Library under Java Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  Java.util Library topic of Java Programming:

 

1. Which of these method is used to change an element in a LinkedList Object?

Answer: Option C

Explanation:
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.

2. Which of these method of ArrayList class is used to obtain present size of an object?

Answer: Option A

Explanation:

3.  Which of these standard collection classes implements all the standard functions on list data structure?

Answer: Option A

Explanation:

4.  Which of these methods can be used to obtain set of all keys in a map?

Answer: Option D

Explanation:
keySet() methods is used to get a set containing all the keys used in a map. This method provides set view of the keys in the invoking map.

5. Which of these methods can be used to search an element in a list?

Answer: Option D

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

6. Which of these method Map class is used to obtain an element in the map having specified key?

Answer: Option A

Explanation:

7. Which of these methods can be used to delete the last element in a LinkedList object?

Answer: Option C

Explanation:
removeLast() and removeFirst() methods are used to remove elements in end and beginning of a linked list.

8. Which of these methods is used to add elements in vector at specific location?

Answer: Option D

Explanation:
addElement() is used to add data in the vector, to obtain the data we use elementAt() and to first and last element we use firstElement() and lastElement() respectively.

9.  Which of these class can generate an array which can increase and decrease in size automatically?

Answer: Option A

Explanation:

10. Which of these method of Array class is used sort an array or its subset?

Answer: Option C

Explanation:

11. Which of these is the interface of legacy?

Answer: Option B

Explanation:

12. Which of these method is used to calculate number of bits required to hold the BitSet object?

Answer: Option B

Explanation:

13.  Which of these standard collection classes implements a linked list data structure?

Answer: Option B

Explanation:

14. Which of these method is used to change an element in a LinkedList Object?

Answer: Option C

Explanation:
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.

15. Which of these methods is used to retrieve the elements in properties object at specific location?

Answer: Option D

Explanation: