Skip to content

saynomorecode/Java_OOPs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

164 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java_OOPs

Basic Level

1.Introduction to OOP

Principles of OOP: Encapsulation, Abstraction, Inheritance, Polymorphism

Differences between Procedural and Object-Oriented Programming

Object-Oriented Programming (OOP) is a programming paradigm that uses objects and classes to organize

and structure software. OOP allows developers to create programs that are more modular, reusable, and

easier to maintain by encapsulating data and behavior within objects.

. Principles of OOP

 # Encapsulation:

 Encapsulation is the bundling of data (variables) and methods (functions) that operate on the data into a
 single unit or class.

It restricts direct access to some of an object's components, which is a means of preventing unintended 
interference and misuse of the data.

Access to the data is controlled through public methods (getters and setters), while the actual data is 
kept private.

# Abstraction:

Abstraction involves hiding the complex implementation details of a system and exposing only the 
essential features to the user.

It allows a programmer to focus on what an object does instead of how it does it.

Abstraction is typically achieved through abstract classes and interfaces.

# Inheritance:

 Inheritance allows a new class (subclass or child class) to inherit the properties and methods of
 an existing class (superclass or parent class).
 It promotes code reusability and establishes a relationship between classes.
 Inheritance is denoted using the extends keyword in Java.


 # Polymorphism:

Polymorphism allows objects to be treated as instances of their parent class rather than their actual class.

It enables a single action to behave differently based on the object that it is acting upon.

Polymorphism is achieved in Java through method overloading (compile-time) and method overriding (runtime).

Differences Between Procedural and Object-Oriented Programming

# Procedural Programming:

. Focuses on functions or procedures that operate on data.

. Data is passed to functions, and functions operate on the data.

. Example languages: C, Pascal.

Structure:

. Data and functions are separate entities.

. Reusability can be difficult since data and functions are not inherently linked.

# Object-Oriented Programming:


. Focuses on objects that combine data and behavior.

. Objects are instances of classes that define data attributes and methods.

. Example languages: Java, C++, Python.

Structure:

. Data and methods are encapsulated within objects.


. Promotes code reusability through inheritance and polymorphism.


. Enhances security by controlling access to data.

2. Classes and Objects

. Creating and using class

Creating and using classes

. Objects and references

Objects and references

. Constructors

. Constructors

. The this keyword

The this keyword

. Methods and overloading

Methods and overloading Methods

3.Encapsulation

Encapsulation

. Access modifiers: private, public, protected, default

Access Modifiers

. Getters and Setters

Getters and Setters

4.Inheritance

Inheritance(1)basic

. Superclasses and subclasses

superclasses and subclasses

. The extends keyword

extends keyword

. The super keyword

Super

. Method overriding

Method Overloading

. The final keyword

final keyword

. Interface

Inheritance(3)Java Interface

. Diamond problem

Inheritance(4)diamond problem

. Inheritance with Abstract

Inheritance(2) Abstract

5.Polymorphism

Polymorphism

. The instanceof keyword

instanceof

6.Abstraction

Abstraction

. Interfaces

. Implementing interfaces

Interfaces

. Difference between abstract classes and interfaces

Abstract Classes and Interfaces

Intermediate Level

1.Inner class

Inner Classes

2.Object Class and Wrapper Classes

Methods of the Object class (toString(), equals(), hashCode(), etc.)

Auto-boxing and unboxing

Wrapper classes for primitive types

Object Class and Wrapper Classes in Java

3.Exception Handling

try, catch, finally

Throwing exceptions

Custom exceptions

Checked vs. unchecked exceptions

Exception Handling

4.Collections Framework

List, Set, Map, Queue interfaces

ArrayList, LinkedList, HashSet, TreeSet, HashMap, TreeMap, etc.

Iterators and enhanced for-loop

Generics in collections

Collections Framework

Hash map.java

Hash set.java

5.File I/O and Serialization and package

File handling using java.io package

Serialization and deserialization

The Serializable interface

Transient keyword

File

java package

problem slove topic wise

OOpCode

OOpCode

project

project

Library Management System

 Online Payment System


Ride-Sharing Application


Array list.java


Array_of_Objects.java


Array_of_object_dynamic.java


Arrayofobject.java


Class.java


Constructor.java

Diamond.java


Encapsulation problem .java


Encapsulation.java


Exception Handling.java


 Hash set .java


Hasp map.java


Hierarchical_Inheritance.java


Hybrid_Inheritance.java


Key Concepts of Encapsulation.java


Method Overloading (Compile-time Polymorphism).java


Method Overriding (Runtime Polymorphism).java


Method.java



Multilevel_Inheritance.java

Multiple_Inheritance.java


Nested Inner class .java


Nested Static Class.java


Object.java



PolyArray.java

Poly_arrayInterface.java


Single_Inheritance.java


Wrapper Classes atuo boxing.java


final.java


polymorphism.java

About

This repository can act as a guide if you are trying to learn Java OOPs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors