This repository contains Java programs demonstrating Object-Oriented Programming (OOP) concepts, with a focus on inner classes and basic inheritance examples.
Object-Oriented Programming helps you build programs using real-world concepts like Car, Student, BankAccount, etc.
Key OOP concepts included in this repository:
-
Class & Object
- A class is a blueprint.
- An object is a real instance created from that blueprint.
-
Constructors
- Constructors initialize object values automatically when an object is created.
-
The
thisKeyword- Refers to the current object.
-
Inheritance
- Allows one class to use properties and methods of another class.
-
Polymorphism
- Many forms — the same method name behaves differently depending on context.
-
Encapsulation
- Keeps data safe using private variables with getters and setters.
-
Abstraction
- Hides complex implementation details and shows only the essentials.
-
Static Keyword
- Belongs to the class, not to any object.
-
Final Keyword
- Prevents changes to variables, methods, or classes.
-
Inner Classes
- Classes defined inside other classes.
- Useful for logically grouping classes that are only used in one place.
-
Exception Handling
- Allows programs to handle runtime errors gracefully using
try,catch, andfinally.
- Allows programs to handle runtime errors gracefully using
-
File Handling
- Enables reading from and writing to files for data storage and retrieval.
-
Collections Framework
- Provides dynamic data structures like
ArrayList,HashMap, andHashSetfor managing data.
- Provides dynamic data structures like
-
Multithreading
- Lets multiple parts of a program run concurrently to improve performance.
-
Lambda Expressions
- Offers a shorter way to define methods or functions inline for cleaner code.
-
Streams API
- Simplifies processing of collections using functional operations like
filter,map, andcollect.
- Simplifies processing of collections using functional operations like
-
Generics
- Allows writing reusable and type-safe code that works with any data type.
-
Serialization
- Converts objects into a byte stream to save or transfer them, and restores them later.