Wednesday Review Quiz

Take this quiz to review yesterday's material. The quiz is open-book, open-note and open-neighbor (feel free to work together)!

For the questions that involve coding, you can just write your answers on a piece of paper -- you don't need to type them into the computer, compile and run them (unless you really want to).

  1. Explain the difference between overloading and overriding methods.
  2. Discuss what the static modifier does on a method definition. How do you call a static method? Write an example.
  3. Suppose you write an application with 20 Java classes. How many source files would you have? How many main methods would you have?
  4. Explain the differences between public, private and package-level access to class members.
  5. Optional Bonus Question  In C++, a class can define a destructor method that the system calls when an object is deallocated. Discuss why Java does not support destructors.