1/27
Flashcards covering key vocabulary and concepts in object-oriented programming (OOP).
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Object-Oriented Programming (OOP)
A programming paradigm that considers data first before actions are designed.
Procedural Programming
A programming paradigm that considers actions first before the data is considered.
Object
A software bundle of related state and behavior; a dynamic instance of a class.
Class
A construct used to define a distinct new type, made up of attributes (properties) and methods (behavior).
Data Encapsulation
Bundling code into individual software objects to provide modularity and prevent unintended access to data.
Data Abstraction
Representing important details while hiding away implementation details.
Inheritance
The process of creating a new class from an existing class, inheriting attributes and behaviors.
Polymorphism
The ability of an object to take on many forms, processing objects differently based on their data type or class.
Class Diagram
A diagram used to show the design of a class, including the class name, attributes, and methods.
Constructor
A method used to create and instantiate an object of a defined class, initializing its attributes.
Default Constructor
A constructor with no parameters, used to initialize attributes with default values (e.g., empty strings, zero for numeric values).
Parameterized Constructor
A constructor that contains parameters used to assign values to the corresponding attributes during object instantiation.
Encapsulation Principle
States that a class's attributes should only be read or written by methods of the class itself; also known as information hiding.
Information Hiding
Declaring all fields and auxiliary methods as private in a class, limiting data access through accessors and mutators.
Access Specifiers
Keywords (public, private, protected) used to identify access rights for data and member functions of a class.
Destructor
A special method called when an object's lifecycle is over to free memory and deallocate resources (common in languages with manual memory management).
Garbage Collector
A program that runs on the JVM and recovers memory by deleting objects that are no longer used or accessible.
Accessor (Getter) Method
A method in a class that provides read access to a private variable, typically prefixed with 'get'.
Mutator (Setter) Method
A method that allows an object or external class to change or set a private variable, typically prefixed with 'set'.
Auxiliary Methods
Other methods (functions and procedures) in a class that assist with the functionality of the class, such as calculations or formatting.
toString() Method
A method that creates a string representation of an object, returning a formatted display of its attributes.
Method Overloading
Having two or more methods in a single class with the same name but different types, order, or number of parameters.
Superclass (Base/Parent Class)
The class whose features are inherited by another class.
Subclass (Derived/Extended/Child Class)
The class that inherits from another class, adding its own fields and methods.
Method Overriding
Implementing a method in a derived class with the same signature as a method in the base class, replacing the base class's functionality.
Compile-Time Polymorphism (Static Polymorphism)
Polymorphism achieved through method overloading, where the compiler determines which method to run.
Runtime Polymorphism (Dynamic Polymorphism)
Polymorphism achieved by overriding a base class method, where the computer determines which method to run at runtime.
Static
A keyword that indicates a variable, method, block of code, or nested class belongs to the class itself rather than to an instance of the class.