cus 1116
CUS1116 Practice Midterm
Short Answer :
There will be a number of short answer questions, covering the readings and the
class notes. The readings have been chapters 1,2, and 8, as well as the material
on reserve.
1. Can you run a program that has a compiler error?
2. Here is a method header for a method that does something
public void doStuff(int num)
If I call it like this, why won’t it compile?
int result = doStuff(30);
3. What is the term for the constructor that takes no arguments, for example
like this one?
public Timer() {
// code
}
4. Is String a primitive type?
5. When you run a Java program, what is the first method that gets run?
6. What are the differences between a primitive type variable and an object?
7. How long does an instance variable last? How long does a local variable
exist?