OOP Flashcards
Class:
Blueprint for creating objects. It defines a data structure that includes data members (fields) and methods.
Object:
An instance of a class. It represents a real-world entity and has state and behavior.
Inheritance:
Mechanism where a new class inherits properties and behaviors from an existing class. It promotes code reuse.
Polymorphism
Ability of a class to take on multiple forms. It allows objects of different classes to be treated as objects of a common base class.
Encapsulation
Bundling of data (attributes) and methods that operate on the data within a single unit (class). It restricts direct access to some of an object’s components.
Abstraction
Concept of hiding complex implementation details and showing only the necessary features of an object.
Constructor
Special method used for initializing objects. It is called when an object is created.
Method Overloading
Defining multiple methods in the same class with the same name but different parameters.
Interface
A collection of abstract methods. It defines a contract for classes that implement it.
Package:
A way to organize related classes into a single directory. It helps in avoiding naming conflicts.
Access Modifiers:
Keywords (public, private, protected) that control the visibility of class members (attributes and methods).
Final Keyword:
A keyword used to make a class, method, or variable unmodifiable or prevent inheritance.
Static Keyword:
A keyword used to define class members that belong to the class rather than instances of the class.
This Keyword:
A keyword used to refer to the current instance of the class. It is used to distinguish between instance variables and method parameters.
Super Keyword:
A keyword used to refer to the superclass. It is used to call methods or access attributes of the superclass.
Method Overriding:
Providing a specific implementation for a method that is already defined in the superclass.