CLASS VARIABLES & STATIC METHODS
WRAPPER CLASSES
METHOD OVERLOADING
SCOPE & VARIABLES
KEY TERMS FOR CLASSES
100

A variable declared with the keyword static inside a class is best described as:

A. Unique to each object
B. Shared by all objects
C. Private to methods only
D. Temporary inside loops

A. Unique to each object

100

Why are wrapper classes needed in Java?

A. To replace classes
B. To store primitives as objects
C. To reduce memory
D. To remove methods

B. To store primitives as objects

100

Method overloading occurs when:

A. Two classes have the same name
B. A method changes visibility
C. Multiple methods share a name but differ in signature
D. A method overrides a parent method

C. Multiple methods share a name but differ in signature

100

Scope refers to:

A. The size of a variable
B. The region where a variable exists
C. The value of a variable
D. The type of a variable

B. The region where a variable exists

100

In Java, the keyword this refers to:

A. The class itself
B. The current object instance
C. A static method
D. A package

B. The current object instance

200

If you want to keep track of how many Student objects have been created across the entire program, which variable should you use?

A. Instance variable
B. Local variable
C. Static variable
D. Parameter variable

C. Static variable

200

Which wrapper class corresponds to the primitive int?

A. Int
B. Integer
C. Double
D. Number

B. Integer

200

A method signature consists of the method name and the:

A. Return type only
B. Parameter list
C. Access modifier
D. Method body

B. Parameter list

200

An instance variable is declared:

A. Inside a loop
B. Inside a method
C. Inside a class but outside methods
D. Inside a package

C. Inside a class but outside methods

200

The keyword this is most commonly used to:

A. Import packages
B. Solve variable shadowing
C. Declare static variables
D. Overload methods

B. Solve variable shadowing

300

A method that can be called using the class name without creating an object must be declared as:

A. private
B. final
C. static
D. public only

C. static

300

An ArrayList cannot store primitive values directly because it requires:

A. Static data
B. Public variables
C. Object types
D. Final values

C. Object types

300

Which change correctly overloads a method?

A. Changing parameter names only
B. Changing return type only
C. Changing number of parameters
D. Changing variable values

C. Changing number of parameters

300

A local variable declared inside a method exists until:

A. The program ends
B. The class ends
C. The block ends
D. The object is destroyed

C. The block ends

300

Which visibility modifier restricts access to within the same class only?

A. public
B. protected
C. private
D. static

C. private

400

Which of the following is a correct reason to use a static method?

A. It changes instance variables
B. It depends on object data
C. It acts as a utility function
D. It creates new objects automatically

C. It acts as a utility function

400

When Java automatically converts an int into an Integer object, this process is called:

A. Unboxing
B. Casting
C. Autoboxing
D. Shadowing

C. Autoboxing

400

Why does changing only parameter names NOT count as overloading?

A. Names are ignored in signatures
B. Names are private
C. Java requires static methods
D. Return type must change

A. Names are ignored in signatures

400

Variable shadowing occurs when:

A. A static variable hides a class
B. Two variables share the same name in different scopes
C. A variable changes type
D. A method is overloaded

B. Two variables share the same name in different scopes

400

According to best practice in AP Java, instance variables should usually be declared:

A. public
B. static
C. protected
D. private

D. private

500

Why are static variables considered efficient in some situations?

A. They create more objects
B. They avoid object instantiation
C. They increase scope
D. They prevent imports

B. They avoid object instantiation

500

When an Integer object is converted back into an int primitive automatically, this process is called:

A. Autoboxing
B. Wrapping
C. Overloading
D. Unboxing

D. Unboxing

500

Why is method overloading useful in program design?

A. It reduces memory usage
B. It allows one intuitive method name for related actions
C. It increases visibility
D. It eliminates parameters

B. It allows one intuitive method name for related actions

500

If you try to use a local variable after its block has ended, the compiler will:

A. Convert it automatically
B. Ignore it
C. Throw an error
D. Make it static

C. Throw an error

500

To use a class from another package, you must write at the top of your file:

A. package className;
B. import package.ClassName;
C. using package;
D. static package;

B. import package.ClassName;