Class Design & Variables
Constructors, Methods & Scope
Access & Static
Objects and References
Trivia Time!
100

What is the difference between a class and an object?

A class is a blueprint; an object is an instance created from that class.

100

What is the purpose of a constructor?

To initialize instance variables when an object is created.

100

What does the private keyword do?

Makes sure that only the methods that belong to the class can access the variable.

100

Why is using multiple classes helpful in a program?

It improves modularity, readability, and maintainability

100

Which TV show holds the record for the most Emmy wins of all time?

Saturday Night Live

200

What type of variable belongs to each individual object created from a class?

Instance variable.

200

What is the difference between a constructor parameter and an instance variable?

Parameters receive values from a Constructor call; instance variables store data for the object.

Constructors usually use the value from parameters to instantiate instance variables. 

200

Why are instance variables usually declared private?

To protect data from being directly access; they can only be accessed by getter or setter methods.

200

What happens when an object is passed into a method as a parameter?

The method can modify the original object.

200

What film won the first Academy Award for Best Animated Feature in 2002?

Shrek

300

What is a static variable?

 A variable shared by all objects of a class.

300

When is a no-parameter constructor valid?

When a class has NO written constructor, or when a class has a manually created no-parameter constructor

300

What is encapsulation?

Restricting direct access to data while providing controlled access through methods.

300

What does it mean when a method returns an object?

It returns a reference to the object, not a copy.

300

What ancient civilization built the city of Machu Picchu?

The Inca

400

Where can a local variable be declared and used?

Inside a method, a constructor, or a control structure.

400

When is a no-parameter constructor NOT automatically available?

When a class defines a constructor with parameters.

400

What types of variables can instance methods modify? 

Both instance and static

400

What is the best practice when an object is passed into a Constructor as a parameter to be assigned to an instance variable? 

Do not use the direct value of the Constructor.  Instead, make a new copy of the Object and assign the copy to the instance variable. 

400

What is the only letter that does not appear in the periodic table of elements?

J

500

Why can local variables never be declared private or public?

Access modifiers apply only to class-level variables (instance or class), not method-level variables.

Local variables ONLY exist within their scope and cannot be accessed outside of a class no matter what. 

500

What keyword is used to distinguish instance variables from parameters with the same name?

The "this" keyword

500

What can a static (class) method NOT access directly?

Instance variables or instance methods

500

Why can changes made to an object inside a method still be seen outside the method?

Because the reference points to the same object in memory.

500

What is the term for the fear of long words? (Closest spelling wins)

Hippopotomonstrosesquipedaliophobia

M
e
n
u