Question
Question 1 So that the collection classes can hold different classes of objects, the text: A.defines collections of class Object B.uses classes of a particular
Question 1
So that the collection classes can hold different classes of objects, the text:
A.defines collections of class Object
B.uses classes of a particular interface
C.creates multiple implementations for each collection
D.uses the Java generics mechanism
E.None of these is correct
2. Suppose we have a linked list of Strings, as defined in the text, named presidents. Suppose it contains three nodes, with first node holding Washington, the second node Adams, and the third node Jefferson. What would be the result of the following code?
LLNode
for (int i = 1; i <= 2; i++)
temp = temp.getLink();
System.out.println(temp.getInfo());
A.runtime error
B."Washington" is printed
C."Adams" is printed
D."Jefferson" is printed
E.None of these is correct
Question 3
Suppose we have a linked list of Strings, as defined in the text, named presidents. Suppose it contains three nodes, with the first node holding Washington, the second node Adams, and the third node Jefferson. What would be the result of the following code?
System.out.println(presidents.getLink().getInfo());
A.runtime error
B."Washington" is printed
C."Adams" is printed
D."Jefferson" is printed
E.None of these is correct
4. The StackInterface interface represents a contract between the implementer of a Stack ADT and the programmer who uses the ADT.
A.True
B.False
5.Our StackUnderflowException code essentially consists of two simple constructors and "packages" and "extends" statements and nothing else.
A. True
B.False
6.It is more efficient to insert a new element into the front of a list of 100 elements held in an array (so that all the other elements move down one slot) than it is to insert a new element into the front of that same list held in a linked list structure.
A.True
B.False
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started