Tuesday/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).
-
Write a for loop that counts from 100 to 0 backwards
by fives and prints the results to the console.
-
What is the difference between the & and &&
operators?
-
Define the notion of an object. What is an object
made up of?
-
Explain what the heap and the stack are in
the Java Virtual Machine.
-
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.