Term
Primitive types in Java may be mutable or immutable |
|
Definition
|
|
Term
In C, if pointer p is set equal to array a, then *(p + 3) is effectively the same thing as a[3] |
|
Definition
|
|
Term
Only checked exceptions are subject to the catch or specify requirement in Java |
|
Definition
|
|
Term
Java reference types can always be extended |
|
Definition
|
|
Term
Assertion checking is typically turned on during development and turned off after delivery |
|
Definition
|
|
Term
TravList s = new AbstractTravList<>(); will NOT compile in Java |
|
Definition
|
|
Term
StackTravList s = new StackTravList<>(); will NOT compile in Java |
|
Definition
|
|
Term
A variable that is declared final in Java is effectively a constant |
|
Definition
|
|
Term
The List method "contains" can be implemented using "IndexOf" |
|
Definition
|
|
Term
It is reasonable to override a secondary method with a primary one if the primary method is more efficient |
|
Definition
|
|
Term
The secondary List method addAll should probably be implemented in ArrayList and LinkedList rather than AbstractList |
|
Definition
|
|
Term
One benefit of a Java interface is that the compiler can check to see if the interface methods have been implemented |
|
Definition
|
|
Term
If you want to use a class in your Java application, the first thing you should do is look at the implementation (code) for the class |
|
Definition
|
|
Term
If a hash table has 5 buckets (0-4), then the last digit of the hash codes in bucket 0 is either 0 or 5 |
|
Definition
|
|
Term
The UNIX command cp *.java ~ copies all java files from the current directory to the parent directory |
|
Definition
|
|
Term
C or Java: Arrays can be declared either on the stack or the heap |
|
Definition
|
|
Term
C or Java: Compiles to machine code |
|
Definition
|
|
Term
C or Java: Periodically runs a garbage collector to free up unused memory |
|
Definition
|
|
Term
C or Java: Throws a runtime exception if array indexes are out of bounds |
|
Definition
|
|
Term
C or Java: Most operating systems are still written in this language due to its low-level capabilities |
|
Definition
|
|
Term
C or Java: Can cause buffer overflow errors if programmers are not careful |
|
Definition
|
|
Term
C or Java: Allows aliasing between mutable types |
|
Definition
|
|
Term
C or Java: Distinguishes between primitive types and reference types |
|
Definition
|
|
Term
C or Java: Has a built-in mechanism for encapsulating data and their operations |
|
Definition
|
|
Term
C or Java: Allows users to write operation signatures in one file and implement them in another |
|
Definition
|
|
Term
All immutable objects must be declared final in Java |
|
Definition
|
|
Term
ArrayList s = new ArrayList<>(); will NOT compile in Java |
|
Definition
|
|
Term
assert is a key word in Java that must always followed by a boolean expression |
|
Definition
|
|
Term
Exceptions should not be used for flow-control |
|
Definition
|
|
Term
FileNotFoundException is an example of a checked exception |
|
Definition
|
|
Term
In C, you must declare variables at the beginning of a block. In Java, best practice is to declare variables close to where you use them. |
|
Definition
|
|
Term
List s = new AbstractList<>(); will NOT compile in Java |
|
Definition
|
|
Term
NullPointerException, IllegalArgumentException, and IllegalStateException are all examples of unchecked exceptions |
|
Definition
|
|
Term
The final part of a try-catch block is always executed regardless of whether an exception is thrown or not |
|
Definition
|
|
Term
The home directory in Unix is represented as two dots: .. |
|
Definition
|
|
Term
C or Java: Allows fine-grained control over hardware |
|
Definition
|
|
Term
C or Java: Allows programmers to access the 61st element of a 60 element array |
|
Definition
|
|
Term
C or Java: Allows two different variables on the stack to access the same memory location in the heap |
|
Definition
|
|
Term
C or Java: Arrays are always on the heap |
|
Definition
|
|
Term
C or Java: Catches null-pointer errors at compile time |
|
Definition
|
|
Term
C or Java: Encapsulates data with operations that manipulate that data |
|
Definition
|
|
Term
C or Java: Has a boolean type |
|
Definition
|
|
Term
C or Java: Is subject to buffer overflow attacks |
|
Definition
|
|
Term
C or Java: Requires programmers to declare functions/methods before using them |
|
Definition
|
|
Term
C or Java: Requires programmers to manage (allocate and free) memory manually |
|
Definition
|
|
Term
C or Java: Runs programs on a virtual machine |
|
Definition
|
|
Term
What is printed in the following code? String[] text = new String[10]; System.out.println(text[0]); A. Nothing - the array has not been initialized B. Nothing - an out-of-bounds error will occur C. Nothing - a null-pointer exception will occur D. The empty string |
|
Definition
|
|
Term
Give the condition that ensures the index variable i is within the legal bounds A. 0 <= i < elements.length B. 0 <= i < && i < elements.length() C. 0 <= i < elements.length() D. 0 <= i && i < elements.length |
|
Definition
|
|
Term
Which statement declares and initializes an array of prime numbers? A. int[] primes = {1, 2, 3, 5, 7} B. int() primes = [1, 2, 3, 5, 7] C. int[] primes = [1, 2, 3, 5, 7] D. int() primes = {1, 2, 3, 5, 7} |
|
Definition
|
|
Term
Which expression pair characterizes the first and last elements of an array list? A. 0, list.length B. 0, list.size() C. 0, list.size() - 1 D. 1, list.size() |
|
Definition
|
|
Term
Assume that "list" is an array list with at least one element. How can we remove the last element? A. list[list.length - 1] = null; B. list.get(list.size()); C. list.remove(list.last); D. list.remove(list.size() - 1) |
|
Definition
|
|
Term
Which statement inserts the first element in an array list? A. list.insert(0, "John"); B. list.add(1, "John"); C. list.insert(1, "John"); D. list.add(0, "John"); |
|
Definition
|
|
Term
Suppose we have an array list named "list" whose representation is: elements --> [A B C D /]; size = 4; capacity = 5 What is the effect of calling list.remove(1) on the representation? A. elements --> [A / C D /]; size = 3; capacity = 5 B. elements --> [A C D / /]; size = 3; capacity = 5 C. elements --> [/ B C D /]; size = 3; capacity = 5 D. elements --> [A B C / /]; size = 3; capacity = 4 |
|
Definition
|
|
Term
Suppose we have an array list named "list" whose representation is: elements --> [A B C D E]; size = 5; capacity = 5 What is the effect of calling list.add(X) on the representation? A. elements --> [A B C D E X / / / /]; size = 6; capacity = 10 B. elements --> [A B C D E X]; size = 6; capacity = 6 C. elements --> [X A B C D E]; size = 6; capacity = 6 D. elements --> [A B C D E X]; size = 6; capacity = 5 |
|
Definition
|
|
Term
Which best describes what happens in the implementation of list.add(5, X) for an array list? A. Elements moved right from 5 to size-1 and X inserted at 5 B. Elements moved right from size-1 to 5 and X inserted at 5 C. X inserted at 5 and elements moved right from 5 to size-1 D. X inserted at 5 and elements moved right from size-1 to 5 |
|
Definition
|
|
Term
What is the last copy in an ArrayList with 10 elements in list.remove(5)? A. elements[5] is copied to the return value B. elements[6] is copied to elements[5] C. elements[9] is copied to elements[8] D. elements[10] is copied to elements[9] |
|
Definition
|
|
Term
How many nodes does a Java linked list have when it is empty? A. None B. One C. Two D. Ten |
|
Definition
|
|
Term
Which is most appropriate to print out the elements of an ArrayList? A. for(E elem : elements) System.out.println(elem); B. for(int i = 0; i < elements.length; i++) System.out.println(elements[i]); C. for(int i = 0; i < capacity; i++) System.out.println(elements[i]); D. for(int i = 0; i < size; i++) System.out.println(elements[i]); |
|
Definition
|
|
Term
What code might we see when printing elements of a non-empty LinkedList? A. Node temp = header; while(temp != header) //print temp.contents B. Node temp = header; for(int i = 0; i < size; i++) //print temp.contents C. for(int i = 0; i < size; i++) //print header.contents[i] D. Node temp = header.next; while(temp ! = header) //print temp.contents |
|
Definition
|
|
Term
When we consider an abstract view of a linked list or array list, what do we NOT consider? A. The efficiency of the operations B. The behavior of the operations C. Implementation details D. A and C E. B and C |
|
Definition
|
|
Term
We might choose to use an array list over a linked list because we will NOT require frequent A. Random access B. Inserting new elements C. Removing of elements D. B and C |
|
Definition
|
|
Term
Primary methods may be implemented in A. Interfaces B. Abstract Classes C. Concrete Classes D. B and C |
|
Definition
|
|
Term
Secondary methods may be implemented in A. Interfaces B. Abstract Classes C. Concrete Classes D. B and C |
|
Definition
|
|
Term
The new keyword in Java may be used in front of A. Interfaces B. Abstract Classes C. Concrete Classes D. B and C |
|
Definition
|
|
Term
Doctor has field worksAtHospital and method treatPatient(). Surgeon extends Doctor, overriding treatPatient() and adding makeIncision(). How many fields and methods does Surgeon have? Fields: A. 0 B. 1 C. 2 D. 3 Method: A. 0 B. 1 C. 2 D. 3 |
|
Definition
|
|
Term
Doctor has fields worksAtHospital and method treatPatient(). FamilyDoctor extends Doctor, adding field makesHouseCalls and method giveAdvice(). How many fields and methods does FamilyDoctor have? Fields: A. 0 B. 1 C. 2 D. 3 Method: A. 0 B. 1 C. 2 D. 3 |
|
Definition
|
|
Term
If you declare a class T as final, you cannot reassign to any variables with type T. |
|
Definition
|
|
Term
In Java, array always reside on the heap, but in C, arrays may reside on the heap or the stack. |
|
Definition
|
|
Term
A variable's apparent type should be equal or be a subtype of its actual type. |
|
Definition
|
|
Term
A Java class may implement multiple interfaces |
|
Definition
|
|
Term
A checked exception must be caught or thrown further up the stack |
|
Definition
|
|
Term
A primary method does not need to be implemented in a concrete class |
|
Definition
|
|
Term
"hello" == new String("hello") |
|
Definition
|
|
Term
If a Java array has length 5 and x is an int, then x%5 is a valid index in the array |
|
Definition
|
|
Term
If x=8 is a Java int, the value of x<<2 is 2 |
|
Definition
|
|
Term
If x = true and y = false, then !(x&&y) is true |
|
Definition
|
|
Term
(y/x>5||x==0) will throw an exception if x==0 |
|
Definition
|
|
Term
Interaction Design focuses on how people interact with technology |
|
Definition
|
|
Term
An example of a physical constraint is that most pieces for a Lego motorcycle will only fit together one way |
|
Definition
|
|
Term
An example of a cultural constraint is that a motorcycle rider needs to see where he is going, so he must face the front |
|
Definition
|
|
Term
What some people consider human error is often the result of poor design. |
|
Definition
|
|
Term
This component is the only major component that is NOT a child of the content pane |
|
Definition
|
|
Term
This component is typically used for entering a single line of text |
|
Definition
|
|
Term
This component sits between the top level component and most other components like buttons, labels, and text areas |
|
Definition
|
|
Term
This layout manager is recommended for the most complicated layouts |
|
Definition
|
|
Term
This layout puts components in a single row or column and typically respects requested maximum sizes |
|
Definition
|
|
Term
This method is called by repaint to update the display of graphical objects |
|
Definition
|
|
Term
Use this listener to respond to a button click |
|
Definition
|
|
Term
Use this listener to respond to mouse events such as pressing and releasing a mouse button |
|
Definition
|
|
Term
A hashCode should be unique as possible, e.g., the hashCode for "tea" should not be the same as the hashCode for "eat" |
|
Definition
|
|
Term
ArraySet and ListSet are two of the most common implementations for Sets in Java |
|
Definition
|
|
Term
If a.equals(b) is true, then a.hashCode() == b.hashCode() should also be true |
|
Definition
|
|
Term
In a hash table with 10 buckets (0-9), the bucket that holds an object equals the last digit of the object's hashCode |
|
Definition
|
|
Term
To modify a key-value pair in a Java Map, you use the same method as you do to add a new key-value pair to the Map |
|
Definition
|
|
Term
TreeSet is used for Sets that need to be maintained in sorted order |
|
Definition
|
|
Term
In the Java collections framework, which pattern allows programmers to use the enhanced for-loop? |
|
Definition
|
|
Term
In the Java GUI framework, which pattern allows objects to listen for GUI events? |
|
Definition
|
|
Term
In the Java IO framework, which pattern lets you wrap readers and writers in other readers and writers? |
|
Definition
|
|
Term
This pattern converts the interface of a class into another interface the clients expect |
|
Definition
|
|
Term
This pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable at runtime |
|
Definition
|
|
Term
This pattern defines an interface for creating an object, but lets subclasses decide which class to instantiate |
|
Definition
|
|
Term
This pattern ensures that a class has only one instance and provides a global point of access to it |
|
Definition
|
|
Term
This pattern ensures that when one object changes state, all dependents are notified and updated automatically |
|
Definition
|
|
Term
This pattern lets clients treat individual object and groups of objects uniformly |
|
Definition
|
|
Term
This pattern provides access to elements of an aggregate object without exposing its underlying representation |
|
Definition
|
|
Term
This pattern wraps an object, allowing you to attach additional functionality to it dynamically |
|
Definition
|
|
Term
Decide how much time and money will be spent |
|
Definition
|
|
Term
Decide what the software will do |
|
Definition
|
|
Term
Specify objects in the problem domain |
|
Definition
|
|
Term
Specify software objects and how they collaborate |
|
Definition
|
|
Term
Developers actually write the code |
|
Definition
|
|
Term
Verification and validation take place |
|
Definition
|
|
Term
Enhancement, bug fixes, and adaptation to new environments |
|
Definition
|
|
Term
A disciplined technique for strengthening the internal design of existing code without affecting functionality |
|
Definition
|
|
Term
A good rule of thumb is that the size of these should be about the same size as your production code |
|
Definition
|
|
Term
Allows you to quickly detect any defect that may have been introduced when you are changing things |
|
Definition
|
|
Term
If you can't build all you intended, you must slip functionality; you must not slip the delivery date |
|
Definition
|
|
Term
Involves a fully automated build process that begins when any team member checks code into a code base |
|
Definition
|
|
Term
This type of software used to keep track of changes to the code |
|
Definition
|
|
Term
Barbs on barbed-wire fence: False/Anti/Invisible Affordance or Signifier? |
|
Definition
|
|
Term
Beware of dog sign: False/Anti/Invisible Affordance or Signifier? |
|
Definition
|
|
Term
High-voltage wire: False/Anti/Invisible Affordance or Signifier? |
|
Definition
Invisible anti-affordance |
|
|
Term
Placebo button: False/Anti/Invisible Affordance or Signifier? |
|
Definition
|
|
Term
This UML diagram depicts which method calls which other methods during a particular run of the system |
|
Definition
|
|
Term
This UML diagram describes how events make changes (transitions) to a system over its lifetime |
|
Definition
|
|
Term
This UML diagram describes the static relationships that exist between components of a system |
|
Definition
|
|
Term
This UML diagram is similar to a flow chart |
|
Definition
|
|
Term
This UML diagram shows how external entities interact with various system requirements |
|
Definition
|
|
Term
This UML diagram shows you the physical location of software components |
|
Definition
|
|
Term
This UML diagram uses special columns to indicate who performs a particular activity |
|
Definition
|
|