With All Correct Answers 2025 Latest
Update!!!!
Queue CORRECT ANSWERS This structure is the best model for a group of customers
waiting to check out in a grocery store.
extending CORRECT ANSWERS Java programmers define their own exceptions by
________________ the library's Exception class.
D CORRECT ANSWERS Polymorphism means:
A. methods like toString can be defined in many different classes
B. a class can extend multiple other classes
C. many object can be instantiated from a single class definition
D. an object variable might reference objects of different classes at different times.
value CORRECT ANSWERS In Java, method arguments are passed by:
throw CORRECT ANSWERS This Java statement is used to "announce" that an
exception has occurred.
true CORRECT ANSWERS Java supports single inheritance only, i.e., a class can only
directly inherit from a single superclass.
false CORRECT ANSWERS True or False? The following code results in garbage
being created:
Circle c1 = new Circle(8);Circle c2;c2 = c1;
true CORRECT ANSWERS True or False? Subclasses are assignment compatible with
the superclasses above them in the inheritance hierarchy.
false CORRECT ANSWERS A private variable cannot be accessed from anywhere.
true CORRECT ANSWERS A class definition can be used to create multiple objects.
abstract (or logical) CORRECT ANSWERS We deal with ADTs on three levels. On
which level do we just deal with the "what" questions, as inwhat does the ADT model
do, what are its responsibilities, what is its interface?
, A CORRECT ANSWERS Recall that within the ArrayBoundedStack the topIndex
variable holds the index of the elements array where the current top of stack is stored. If
a stack is empty, then its topIndex variable is:
A. -1
B. 0
C. 1
D. DEFCAP
E. None of these is correct
2, 1 CORRECT ANSWERS Starting with an empty stack the sequence of operations
push(1), push(2), push(3), pop(), leaves thestack, from top to bottom, as:
B CORRECT ANSWERS The text's ArrayListStack class:
A. implements a bounded stack
B. implements the text's StackInterface
C. provides the classic pop operation
D. has an inefficient isEmpty operation
E CORRECT ANSWERS In the following command sequence, numbered blocks are
pushed and popped from a stack. Supposethat every time a block is popped, its
numerical value is printed. What is the sequence of values that areprinted? Assume you
begin with an empty stack: push block5; push block7; pop; pop; push block2;
pushblock1; pop; push block8;
A. 5 7 2
B. 8 1 2
C. 1 2 7
D. 2 7 5
E. None of these are correct
true CORRECT ANSWERS The StackOverflowException is an unchecked exception..
true CORRECT ANSWERS UML diagrams are a form of abstraction, since they hide
details and allow us to concentrate just on the major design components.
false CORRECT ANSWERS If N represents the maximum possible number of elements
on the stack, then the LinkedStackconstructor is O(N).
true CORRECT ANSWERS The following expression is balanced: ( ( xx [ {{ ** }} ] XX ) )
false CORRECT ANSWERS If N represents the number of elements on the stack, then
the isFull method of theArrayBoundedStack class is O(N).