Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

1. Which of these methods is used to add an element at the end of a List?

View

2. Which List implementation is thread-safe by default?

View

3. Which Set implementation guarantees that elements are sorted in natural order?

View

4. Which method is used to check if an element exists in a Set?

View

5. What is the default order in which elements are stored in a HashSet?

View

6. What happens when you add an element to an ArrayList and it exceeds its current capacity?

View

7. Which of the following methods is used to remove an element from a specific index in an ArrayList?

View

8. Which of the following methods is not part of the Set interface?

View

9. Which of the following statements is true for a TreeSet?

View

10. What will happen if you try to access an element at an index that is out of bounds in an ArrayList?

View

1. Which of these methods is used to add an element at the end of a List?

add()
insert()
push()
append()

2. Which List implementation is thread-safe by default?

ArrayList
LinkedList
Vector
None of the above

3. Which Set implementation guarantees that elements are sorted in natural order?

TreeSet
HashSet
LinkedHashSet
None of the above

4. Which method is used to check if an element exists in a Set?

contains()
has()
exists()
check()

5. What is the default order in which elements are stored in a HashSet?

Natural order
Insertion order
No specific order
Alphabetical orde

6. What happens when you add an element to an ArrayList and it exceeds its current capacity?

<p>&nbsp;</p>

The ArrayList throws an exception
The ArrayList grows by a fixed size
The ArrayList automatically resizes to accommodate more elements
It overwrites the first element

7. Which of the following methods is used to remove an element from a specific index in an ArrayList?

remove()
delete()
pop()
discard()

8. Which of the following methods is not part of the Set interface?

add()
remove()
put()
clear()

9. Which of the following statements is true for a TreeSet?

<p>&nbsp;</p>

It does not allow null elements
It stores elements in sorted order
It allows duplicates
It is backed by a hash table

10. What will happen if you try to access an element at an index that is out of bounds in an ArrayList?

It will return null
It will throw IndexOutOfBoundsException
It will resize the ArrayList to accommodate the new index
It will ignore the operation