Assume you have created a linked list named myList that currently holds some number of String objects. Which of the following statements correctly adds a new element to the beginning of myList?
A) myList.addFirst("Harry") ;
B) myList.add("Harry") ;
C) myList.insert("Harry") ;
D) myList.put("Harry") ;
Correct Answer:
Verified
Q12: Which Java package contains the LinkedList class?
A)java.lang
B)java.util
C)java.collections
D)java.io
Q34: When using a list iterator, on which
Q35: A(n) _ is a data structure used
Q36: Consider the code snippet shown below. Assume
Q37: Which method is NOT part of the
Q39: When using a list iterator, on which
Q40: Select an appropriate expression to complete the
Q41: Which of the following statements about manipulating
Q42: A linked list allows _ access, but
Q43: Assume that you have declared a set
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents