QUESTIONS AND DETAILED DATA STRUCTURES
AND ALGORITHMS BREAKDOWN
◉ You can always use a sub-class object in place of a super class
object. Answer: True
◉ We can implement a getter method without a setter method, thus
creating a read-only value. Answer: True
◉ A Stack is a Last In First Out (LIFO) data structure. Answer: true
◉ Which object oriented element best allows us to designing and
implementing families of related types that share outward
similarities, but have specialized behaviors? Answer: Polymorphism
◉ The benefit of data hiding is that we can make an object truly
responsible for what it knows and what it does. Answer: True
◉ An "has a" relationship is implemented by composition. Answer:
True
,◉ Stacks and Queues can be implemented as ArrayLists or
LinkedLists. Answer: True
◉ During what activity do we directly analyze the language of the
problem to identify objects, their attributes, and their behaviors?
Answer: none of these
◉ In general, a setter method will take at least one argument.
Answer: true
◉ A default constructor takes _____ argument(s). Answer: 0
◉ In general, data hiding means that an object keeps what it knows
private. Answer: True
◉ You can create an object from a concrete class, but not from an
abstract class. Answer: True
◉ A subclass that inherits instance variables from its super class
cannot declare additional instance variables. Answer: false
◉ The "extends" keyword is not used to specify inheritance in Java.
Answer: false
,◉ A super class extends a sub-class. Answer: false
◉ Encapsulation is about assigning responsibilities to objects.
Answer: True
◉ Which object oriented element is used to define "is a"
relationships? Answer: Inheritence
◉ A name defined in an inner scope is not available outside that
block. Answer: True
◉ The "inherits" keyword is used to specify inheritance in Java.
Answer: False, (extends keyword is used to specify inheritance in
java.)
◉ The Java keyword throw is used to catch an exception. Answer:
False
◉ Any recursive algorithm can be written iteratively. Answer: True
◉ The index of the last element of an array with a size of 5 elements
is _____. Answer: 4
, ◉ We can use a variable as an index expression to access an array
element in Java. Answer: True
◉ To help us collect information from the user through the keyboard
in Java, we use a(n) _____. Answer: Scanner
◉ Java Boolean literal values are expressed in all lowercase. Answer:
True
◉ Which of the following would have a exponential Big O run-time
complexity?
Compute the area of a circle given the radius
Determine if two logical statements are equivalent by brute force
Find the phone number in a phone book, given a person's name
Delete a value from an ArrayList
none of these Answer: Determine if two logical statements are
equivalent by brute force
◉ Which of the following would have a logarithmic Big O run-time
complexity?
Determine if two logical statements are equivalent by brute force