What is the principle difference in behavior between a stack and a queue?
D. a stack preserves order whereas a queue reverses order
D. None of the above
A ______ can be used to reverse the order of a set of data.
D. Heaps
A pop operation on a Stack returns a(n)
D. pointer
D. size
Which of the following is the correct way to instantiate an array of 10 generic
objects? A. T[] x = new T[10];
Elements in a collection are typically organized by
A. the order of their addition to the collection
E. None of the above
A polymorphic reference uses _______________, not the type of the reference,
to determine which version of a method to invoke.
D. none of the above
In an array implementation of a Stack, the array is ___________ causing the
implementation to have to create a new larger array and copy the contents of the
stack into the new array in order to expand the capacity of the stack.
A. Dynamic
The variable top in the array implementation of a Stack refers to
A. The next available position in the array
B. The item at the top of the Stack
were to place elements on a collection and then wanted to reverse the order,
would it be better to use a Stack or a Queue?
If an exception occurs during the execution of a java program and is not handled
under a common name.
The term polymorphism refers to a reference variable that can point to different
types of objects. This can be accomplished in Java through the use of
hidden.
exception that may be thrown within the try block.
separating the concept of an abstract data type from its implementation.
The toString and equals methods are defined in the Object class and therefore
time.
related to it by inheritance.
commit the method to the use of any particular class that implements a stack.
propagated to the calling method.
way users interact with the collection.
capacity limitations.
element currently stored at the top of the stack and adjusting the top reference to
the new top of the stack.
implement a collection.
in is the first element out.
if they had been declared locally.
classes.
reasonable, minimizing maintenance efforts.
top of the stack at the position 0 of the array?
What is a collection?
What is a data type?
What is an abstract data type?
What is a data structure?
Why is a class an excellent representation of an abstract data type?
What are the five basic operations on a stack?
The operations are:
Define inheritance.
Define polymorphism.
The term polymorphism can be defined as “having many forms.” A
Given the example in Figure 3.5, will the following code compile?
Given the example in Figure 3.5, will the following code compile?
Horse creature = new Mammal();
What is the purpose of Generics in the Java language?
What is the advantage of postfix notation?