What is a class?
A class is a template that defines the common structure and behavior of a kind of object.
Study 2 Classes and Objects with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is a class?
A class is a template that defines the common structure and behavior of a kind of object.
What is the purpose of a constructor?
A constructor initializes a new object's initial state and helps ensure required values are valid.
What is an object?
An object is a concrete instance of a class with its own identity and state.
What does instantiation mean?
Instantiation is the process of creating a concrete object from a class.
What is a field?
A field is a variable associated with a class or object that stores data.
What makes up an object's state?
An object's state is the collection of values held by its instance fields at a particular time.
What is a method?
A method is a function defined as part of a class that provides behavior for an object or class.
What does this refer to in an instance method?
Within an instance method, this commonly refers to the current object on which the method was called.
What is constructor overloading?
Constructor overloading provides multiple constructors with different parameter lists.
What is encapsulation?
Encapsulation protects an object's state by controlling access to fields through carefully designed methods or properties.
What does object identity distinguish?
Object identity distinguishes a particular object from others, even when their field values are equal.
What is aliasing?
Aliasing occurs when multiple variables or names refer to the same object.