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).
-
Explain the difference between overloading
and overriding methods.
-
Discuss what the static modifier does on
a method definition. How do you call a static method?
Write an example.
-
Suppose you write an application with 20 Java classes.
How many source files would you have? How many main
methods would you have?
-
Explain the differences between public, private
and package-level access to class members.
-
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.