Objects: Instances of Classes - AP Computer Science A
Card 1 of 30
Which collection allows duplicate elements?
Which collection allows duplicate elements?
Tap to reveal answer
List. Ordered collections that maintain insertion order and duplicates.
List. Ordered collections that maintain insertion order and duplicates.
← Didn't Know|Knew It →
What is an object in Java?
What is an object in Java?
Tap to reveal answer
An instance of a class. Objects are concrete realizations of classes with specific data values.
An instance of a class. Objects are concrete realizations of classes with specific data values.
← Didn't Know|Knew It →
Identify the method used to initialize an object in Java.
Identify the method used to initialize an object in Java.
Tap to reveal answer
Constructor. Constructors set initial values for object instance variables.
Constructor. Constructors set initial values for object instance variables.
← Didn't Know|Knew It →
What does the 'this' keyword represent in a class?
What does the 'this' keyword represent in a class?
Tap to reveal answer
Current object instance. Allows access to current object's fields and methods within class.
Current object instance. Allows access to current object's fields and methods within class.
← Didn't Know|Knew It →
Which method is called automatically when an object is created?
Which method is called automatically when an object is created?
Tap to reveal answer
Constructor. Constructors execute automatically during object creation process.
Constructor. Constructors execute automatically during object creation process.
← Didn't Know|Knew It →
What is the default value of an object reference in Java?
What is the default value of an object reference in Java?
Tap to reveal answer
null. Uninitialized object references automatically default to null value.
null. Uninitialized object references automatically default to null value.
← Didn't Know|Knew It →
What is encapsulation in object-oriented programming?
What is encapsulation in object-oriented programming?
Tap to reveal answer
Hiding internal state and requiring all interaction through methods. Protects data integrity by controlling access through methods.
Hiding internal state and requiring all interaction through methods. Protects data integrity by controlling access through methods.
← Didn't Know|Knew It →
What is the process of creating an object called?
What is the process of creating an object called?
Tap to reveal answer
Instantiation. The act of creating a specific object from a class blueprint.
Instantiation. The act of creating a specific object from a class blueprint.
← Didn't Know|Knew It →
Which access modifier makes a class member accessible from any other class?
Which access modifier makes a class member accessible from any other class?
Tap to reveal answer
public. Provides unrestricted access across all classes and packages.
public. Provides unrestricted access across all classes and packages.
← Didn't Know|Knew It →
What is the result of calling a constructor with no arguments?
What is the result of calling a constructor with no arguments?
Tap to reveal answer
Default constructor is invoked. Creates object with default field values when no parameters given.
Default constructor is invoked. Creates object with default field values when no parameters given.
← Didn't Know|Knew It →
Which function is used to compare two objects for equality?
Which function is used to compare two objects for equality?
Tap to reveal answer
equals(). Compares object content rather than reference addresses.
equals(). Compares object content rather than reference addresses.
← Didn't Know|Knew It →
Which keyword is used to define an interface?
Which keyword is used to define an interface?
Tap to reveal answer
interface. Defines contracts that implementing classes must fulfill.
interface. Defines contracts that implementing classes must fulfill.
← Didn't Know|Knew It →
Identify the keyword that prevents a class from being subclassed.
Identify the keyword that prevents a class from being subclassed.
Tap to reveal answer
final. Prevents inheritance by making class non-extendable.
final. Prevents inheritance by making class non-extendable.
← Didn't Know|Knew It →
What does 'instance variable' mean?
What does 'instance variable' mean?
Tap to reveal answer
A variable defined in a class for which each instantiated object has its own value. Each object maintains its own copy of these variables.
A variable defined in a class for which each instantiated object has its own value. Each object maintains its own copy of these variables.
← Didn't Know|Knew It →
How do you access a class variable?
How do you access a class variable?
Tap to reveal answer
ClassName.variableName. Static variables belong to class, accessed via class name.
ClassName.variableName. Static variables belong to class, accessed via class name.
← Didn't Know|Knew It →
Which keyword is used to refer to the current instance of a class?
Which keyword is used to refer to the current instance of a class?
Tap to reveal answer
this. References the specific object calling the method or constructor.
this. References the specific object calling the method or constructor.
← Didn't Know|Knew It →
Identify the keyword used to inherit from another class.
Identify the keyword used to inherit from another class.
Tap to reveal answer
extends. Establishes parent-child relationship between classes for code reuse.
extends. Establishes parent-child relationship between classes for code reuse.
← Didn't Know|Knew It →
Which operator is used to check if two references point to the same object?
Which operator is used to check if two references point to the same object?
Tap to reveal answer
==. Tests reference equality, not object content comparison.
==. Tests reference equality, not object content comparison.
← Didn't Know|Knew It →
Identify the method that returns a string representation of an object.
Identify the method that returns a string representation of an object.
Tap to reveal answer
toString(). Provides readable text representation for debugging and display.
toString(). Provides readable text representation for debugging and display.
← Didn't Know|Knew It →
Identify the keyword used to inherit from another class.
Identify the keyword used to inherit from another class.
Tap to reveal answer
extends. Establishes parent-child relationship between classes for code reuse.
extends. Establishes parent-child relationship between classes for code reuse.
← Didn't Know|Knew It →
Which collection allows duplicate elements?
Which collection allows duplicate elements?
Tap to reveal answer
List. Ordered collections that maintain insertion order and duplicates.
List. Ordered collections that maintain insertion order and duplicates.
← Didn't Know|Knew It →
What is the result of calling a constructor with no arguments?
What is the result of calling a constructor with no arguments?
Tap to reveal answer
Default constructor is invoked. Creates object with default field values when no parameters given.
Default constructor is invoked. Creates object with default field values when no parameters given.
← Didn't Know|Knew It →
What type of method can only be called from an instance of the class?
What type of method can only be called from an instance of the class?
Tap to reveal answer
Instance method. Non-static methods require object instance to be invoked.
Instance method. Non-static methods require object instance to be invoked.
← Didn't Know|Knew It →
Which keyword is used to refer to the current instance of a class?
Which keyword is used to refer to the current instance of a class?
Tap to reveal answer
this. References the specific object calling the method or constructor.
this. References the specific object calling the method or constructor.
← Didn't Know|Knew It →
Which keyword is used to declare a constant in Java?
Which keyword is used to declare a constant in Java?
Tap to reveal answer
final. Makes variables immutable after initial assignment.
final. Makes variables immutable after initial assignment.
← Didn't Know|Knew It →
What is polymorphism in object-oriented programming?
What is polymorphism in object-oriented programming?
Tap to reveal answer
Ability of different classes to be treated as instances of the same class through inheritance. Enables single interface to represent different underlying types.
Ability of different classes to be treated as instances of the same class through inheritance. Enables single interface to represent different underlying types.
← Didn't Know|Knew It →
Identify the keyword used to implement an interface.
Identify the keyword used to implement an interface.
Tap to reveal answer
implements. Establishes contract between interface and implementing class.
implements. Establishes contract between interface and implementing class.
← Didn't Know|Knew It →
What is the process of creating an object called?
What is the process of creating an object called?
Tap to reveal answer
Instantiation. The act of creating a specific object from a class blueprint.
Instantiation. The act of creating a specific object from a class blueprint.
← Didn't Know|Knew It →
Identify the keyword that prevents a class from being subclassed.
Identify the keyword that prevents a class from being subclassed.
Tap to reveal answer
final. Prevents inheritance by making class non-extendable.
final. Prevents inheritance by making class non-extendable.
← Didn't Know|Knew It →
What does 'instance variable' mean?
What does 'instance variable' mean?
Tap to reveal answer
A variable defined in a class for which each instantiated object has its own value. Each object maintains its own copy of these variables.
A variable defined in a class for which each instantiated object has its own value. Each object maintains its own copy of these variables.
← Didn't Know|Knew It →