Tag: architecture

Questions Related to architecture

  1. Methods cannot be overridden to be more private

  2. static methods cannot be overloaded

  3. private methods cannot be overloaded

  4. An overloaded method cannot throw exceptions not checked in the base class


Correct Option: A
  1. Set

  2. List

  3. Map

  4. Vector


Correct Option: A
Explanation:

To store unique object elements without sorting, the most suitable interface would be a Set.

A Set is a collection that contains no duplicate elements. It provides methods to add, remove, and check if an element is present. Additionally, it does not guarantee the order of the elements.

A List is an ordered collection that allows duplicates. A Map is a collection that maps key-value pairs, and a Vector is a synchronized version of the List interface. None of these interfaces guarantee uniqueness of elements without additional implementation.

Therefore, the option that best suits the given requirement is:

The Answer is: A - Set