You Stay Classy, San Diego
Inherit the Wind
Collections Department
IO U
I Take Exception to That!
100
A set of data and associated methods
What is a class
100
The reason to use inheritance.
What is reusing existing code?
100
A data structure storing the relationship between two sets of data.
What is a Map?
100
A class that can be used to read input from a file?
What is a Scanner?
100
The code used to deal with an exception instead of letting it blow up your code
What is try / catch?
200
A modifier that only allows data or methods to be accessed from within the class
What is private?
200
The reason why methods in super classes are overridden.
What is to provide subclasses with their own unique behavior?
200
Why LinkedList.get(i) is slow
What is LinkedLists do not store index information, only the previous and next elements?
200
A class that can be used to write text to a file.
What is a PrintWriter?
200
The problem with this code try {
// Code that can throw an IOException
} catch (Exception e) {
System.out.println("Something's wrong!");
} catch (IOException e) {
System.out.println("IOException!");
}
What is an IOException will never be caught?
300
The reason setters are evil
What is they break encapsulation? OR They allow the data to be manipulated in ways that may not be intended by objects of this type?
300
Code to call the method bar() in the super class Foo from a subclass of Foo
What is super.bar()?
300
The reason why the Set interface does not have a get(int i) method.
What is sets are unordered collections?
300
The type of exception a PrintWriter and Scanner can throw
What is a FileNotFoundException?
300
The problem with this code: try {
// Stuff that can throw an IOException
} catch (IOException e) {

}
What is squelching an exception?
400
The reason to use a public interface of a clas
What is it allows the programmer to control how the underlying data of the object is manipulated?
400
A class that cannot be instantiated.
What is an abstract class?
400
The reason that it is better for methods to accept Lists as input not ArrayLists or LinkedLists
What is the method shouldn't depend on the specific implementation of the List interface?
400
What happens when you do not close a PrintWriter after writing a file
What is nothing?
400
A method that takes an integer as input and throws an exception if the input is less than zero.
What is: public void method(int i) {
if (i < 0) {
throw new InvalidInputException("Invalid input!");
} // Rest of code }
500
The problem with multiple constructors that take different sets of input arguments.
What is nothing?
500
The meaning of the compile time error "Implicit super constructor Sup() is undefined for default constructor. Must define an explicit constructor"
What is the superclass does not have a default constructor so the subclass must invoke one?
500
The problem with the following
class Foo {
// Data, Constructors, methods, and stuff

public static main(String[] args) {
Set stuff = new TreeSet();
}
}
What is Foo needs to implement the Compator interface?
500
Code to read from one file and write it out line by line to another file
What is
File in = new File("in.txt");
File out = new File("out.txt");
Scanner scanner = new Scanner(in);
PrintWriter writer = new PrintWriter(out);
while (scanner.hasNextLine()) {
writer.println(scanner.nextLine));
}
writer.close();
500
The concept of throw early, catch late.
What is throw the exception as soon as it occurs, only catch it when you can deal with it appropriately?
M
e
n
u