Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 temp = presidents;

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

What three items would you take with you on a deserted island?

Answered: 1 week ago