setSet<E> and list bothList<E> are both used to store the elements of type E.But, set The difference is that Set is stored in unordered way butand does not allow duplicate values.list List is used to store elements in ordered way butand it maydoes allow duplicate values.
setSet elements cannot be accessed by an index position, list and List elements can access by usingbe accessed with an index position.