in Education by
What is the default clone of HashSet? (a) Deep clone (b) Shallow clone (c) Plain clone (d) Hollow clone I have been asked this question in an international level competition. The question is from Data Structures-Set topic in division java.util – The Collections Framework of Java Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
The correct option is (b) Shallow clone Explanation: Default clone() method uses shallow copy. The internal elements are not cloned. A shallow copy only copies the reference object.

Related questions

0 votes
    Do we have get(Object o) method in HashSet. (a) True (b) False The question was posed to me by my ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What are the initial capacity and load factor of HashSet? (a) 10, 1.0 (b) 32, 0.75 (c) 16, 0. ... - The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method of HashSet class is used to add elements to its object? (a) add() (b) Add() ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    When two threads access the same ArrayList object what is the outcome of the program? (a) Both are able ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    How is Arrays.asList() different than the standard way of initialising List? (a) Both are same (b) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What is the difference between length() and size() of ArrayList? (a) length() and size() return the ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which class provides thread safe implementation of List? (a) ArrayList (b) CopyOnWriteArrayList (c) HashList (d) ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of the below is not an implementation of List interface? (a) RoleUnresolvedList (b) Stack (c) AttibuteList ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What is the worst case complexity of accessing an element in ArrayList? (a) O(n) (b) O(1) (c) O( ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What does Collections.emptySet() return? (a) Immutable Set (b) Mutable Set (c) The type of Set ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Set has contains(Object o) method. (a) True (b) False The question was posed to me by my school ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What is the difference between TreeSet and SortedSet? (a) TreeSet is more efficient than SortedSet (b) SortedSet ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What happens if two threads simultaneously modify TreeSet? (a) ConcurrentModificationException is thrown (b) Both threads ... of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these standard collection classes implements a linked list data structure? (a) AbstractList (b) LinkedList ... of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these classes implements Set interface? (a) ArrayList (b) HashSet (c) LinkedList (d) DynamicList I ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
...