SlideShare a Scribd company logo
Module 1: FUNDAMENTALS OF OBJECT ORIENTED PROGRAMMING AND
INTRODUCTION TO JAVA
Introduction to OOPS
Procedural Languages
🔹 Definition:
● Procedural Programming is a programming paradigm based on procedure calls, where code is organized into
functions or procedures.
● Focus: Emphasize a sequence of instructions (procedures or functions) to tell the computer what to do step-by-
step.
● Structure: Programs are organized into a set of functions or subroutines. Data is often separate from the
functions that operate on it.
● Data Handling: Data is typically passed around between functions. Global data might be used, leading to
potential issues (see disadvantages below).
● Examples: C, Pascal, FORTRAN, COBOL.
Characteristics of Procedural Programming:
● Top-Down Approach: The main program is broken down
into smaller functions, each performing a specific task.
● Algorithms First: The primary focus is on designing the
algorithms to solve a problem.
● Global Data: Data can often be accessed and modified
by any function, leading to a "shared memory" model.
Disadvantages of Procedural Programming :
1. Complexity with Large Programs: As programs grow, managing data flow between hundreds of functions
becomes difficult.
2. Lack of Data Security/Integrity: Global data can be accidentally or maliciously modified by any function, leading to
bugs that are hard to trace.
3. Difficult to Model Real-World Problems: Real-world entities have both properties (data) and behaviors (functions).
Procedural languages separate these.
4. Poor Code Reusability: Functions are often specific to the data structures they operate on, making them less
reusable in different contexts.
5. Maintainability Issues: Changes in data structures often require changes in many functions that access that data.
6. Concurrency Challenges: Managing shared global data in multi-threaded environments can lead to complex
synchronization issues.
Definition of OOP (Object-Oriented Programming)
🔹 What is OOP?
● OOP is a programming paradigm that uses objects and classes to structure code.
● It helps in modeling real-world entities like students, employees, cars, etc.
🔹 Origin:
● OOP concept was introduced with Simula (1960s).
● Popularized by C++, later Java, Python, C#, etc.
🔹 Key Principle:
“Combine data and behavior into a single unit called object.”
🔶 Procedural Programming vs OOP
Feature Procedural Programming Object-Oriented Programming (OOP)
Focus Functions (procedures) Objects (data + behavior)
Data Global/shared Encapsulated within objects
Code Reusability Limited (via functions) High (via inheritance, polymorphism)
Modularity Low High
Real-World Modeling Difficult Natural and intuitive
Maintainability Harder in large projects Easier and scalable
Basic concept of OOP
Object
🔹 Definition:
It's a real-world entity that has a state (values for its attributes) and behavior (actions it can perform or that can be performed on it)
● An object is a real-world entity that has:
○ State (data/attributes)
○ Behavior (functions/methods)
● It is a runtime instance of a class.
Key Characteristics:
● It's a physical entity that exists in memory when the program runs.
● Each object has its own unique set of values for the attributes defined by its class.
● Objects communicate with each other by calling each other's methods.
🔹 Example:
In Java:
Dog d1= new Dog(); // d1 is an object
Class
● Definition: A class is a blueprint, a template, or a prototype from which objects are created. It defines the structure
(attributes/fields/properties) and behavior (methods/functions) that all objects of that class will have.
Key Characteristics:
● It's a logical entity, not a physical one (it doesn't consume memory when defined, only when objects are created from it).
● It acts as a user-defined data type.
● It defines the state (data/attributes) and behavior (methods) that its objects will possess.
Class Example :
class Dog { // This is the class definition
// Attributes (State)
String name;
String breed;
int age;
// Methods (Behavior)
void bark() {
System.out.println(name + " says Woof!");
}
void eat() {
System.out.println(name + " is eating.");
}
}
Data Abstraction
🔹 Definition:
● Abstraction means showing only the essential features and hiding the complex implementation details.
● Focuses on what an object does, not how it does it.
🔹 Benefits:
● Simplicity
● Focus on relevant details
● Improved security
Data Encapsulation
🔹 Definition:
● Encapsulation is the process of binding data and methods that operate on that data into a single
unit (class).
● It protects data by making variables private and exposing methods as public.
Benefits:
● Prevents unauthorized access
● Better control of data
● Easy maintenance and testing
Data Hiding
🔹 Definition:
● Data hiding means restricting access to internal object details (like variables).
● Achieved using access modifiers: private, protected, public.
● Only specific parts of code (usually within the same class) can access hidden data.
Member Functions
🔹 Definition:
● Functions (methods) defined inside a class are called member functions.
● Used to operate on data members (variables).
Reusability
🔹 Definition:
● OOP allows you to reuse code by creating reusable classes, especially using inheritance.
● Reduces redundancy and speeds up development.
Inheritance
🔹 Definition:
● Inheritance allows a class (child/subclass) to inherit features (variables and methods) from
another class (parent/superclass).
● Single, Multiple and Hierarchical inheritance
Creating New Data Types
🔹 What it Means:
● In OOP, you can define your own data types using classes.
● These types combine attributes and behaviors into a single structure.
Example:
class Book {
String title;
String author;
double price;
void display() {
System.out.println(title + " by " + author + " costs " + price);
}
}
Polymorphism
🔹 Definition:
● Polymorphism means “many forms”.
● It allows the same function name to behave differently depending on the object or context.
● Compile time and Run time polymorphism
Overloading (Compile-time Polymorphism)
🔹 Definition:
● Same method name with different parameters.
Dynamic Binding (Run-time Polymorphism)
🔹 Definition:
● Method to be called is decided at runtime, using inheritance and overriding.
Message Passing
🔹 Definition:
● Objects communicate with each other by calling methods.
● This is called message passing.
🔹 Example:
car.start(); // 'start' is the message sent to the object 'car'
🧠 Object car receives a message (method call) and responds by executing the method.
1. Modularity
2. Reusability
3. Encapsulation
4. Abstraction
5. Easy Maintenance
6. Polymorphism
7. Scalability and Productivity
8. Improved Software Development Lifecycle
Benefits of Object-Oriented Programming (OOP)
Applications of OOP (in Points)
1. 🎮 Game Development
○ Objects represent players, enemies, weapons, scores, etc.
2. 📱 Mobile Application Development
○ Android (Java/Kotlin) and iOS (Swift) apps use OOP extensively.
3. ️
🖥️Desktop GUI Applications
○ Tools like Java Swing, JavaFX, .NET use objects for buttons, forms, dialogs.
4. 🌐 Web Development (Backend)
○ Languages like PHP, Python (Django), Java (Spring), and Node.js apply OOP for server-side logic.
5. 🧠 Artificial Intelligence & Machine Learning
○ OOP helps structure complex algorithms and data pipelines into reusable modules.
6. 🧪 Scientific and Engineering Applications
○ Simulation, modeling systems, and design tools benefit from modular OOP design.
7. 🛒 E-Commerce Platforms
○ Manage products, users, carts, orders using object-oriented design.
8. 🏥 Healthcare Systems
○ Represent patients, records, appointments, prescriptions as objects.
9. ️
🛠️System Software & Tools
○ Operating system modules, compilers, interpreters use OOP.
10. ️
🗃️Database Management Systems
● ORM tools like Hibernate and Sequelize map database tables to objects.

More Related Content

PDF
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
PPTX
Introduction to OOPs second year cse.pptx
PPTX
bbbnnjxhxshjsjskshsjsjshssddhjddjdjddhgd
PDF
Cs2305 programming paradigms lecturer notes
PPT
Unit 1- Basic concept of object-oriented-programming.ppt
PDF
OOP concepts with respected with Python
PPTX
Introduction to Java -unit-1
PPSX
Object Oriented Programming Overview for the PeopleSoft Developer
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
Introduction to OOPs second year cse.pptx
bbbnnjxhxshjsjskshsjsjshssddhjddjdjddhgd
Cs2305 programming paradigms lecturer notes
Unit 1- Basic concept of object-oriented-programming.ppt
OOP concepts with respected with Python
Introduction to Java -unit-1
Object Oriented Programming Overview for the PeopleSoft Developer

Similar to OOPs Java Module 1.pptx marketing trends social media company profilesmarketing trends social media company profiles (20)

PPTX
Introduction to Object Oriented Programming.pptx
PPTX
PHP OOP Lecture - 01.pptx
PPTX
Object Oriented Program Class 12 Computer Science
PDF
Oops concepts || Object Oriented Programming Concepts in Java
PPTX
Basic Concepts of Object Oriented Programming using C++
PPTX
Principles of OOPs.pptx
PPTX
Object Oriented Programming intro Lecture 1.pptx
PPTX
Introduction to OOP concepts
PPTX
Std 12 computer chapter 6 object oriented concepts (part 1)
PPT
C++Day-1 Introduction.ppt
PDF
OOP lesson1 and Variables.pdf
PPT
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
PPTX
Different paradigms for problem solving.pptx
PPTX
OOP CHAPTER object oreinted programming using c++
PPT
Object Oriented Language
PDF
6_Object-oriented-using-java.pdf object oriented programming concepts
PPTX
SE-IT JAVA LAB OOP CONCEPT
PPTX
Introduction to Object oriented Programming basics
PPTX
CPP-Unit 1.pptx
PPTX
UNIT - 1 Java Fundamentals, Basics of java
Introduction to Object Oriented Programming.pptx
PHP OOP Lecture - 01.pptx
Object Oriented Program Class 12 Computer Science
Oops concepts || Object Oriented Programming Concepts in Java
Basic Concepts of Object Oriented Programming using C++
Principles of OOPs.pptx
Object Oriented Programming intro Lecture 1.pptx
Introduction to OOP concepts
Std 12 computer chapter 6 object oriented concepts (part 1)
C++Day-1 Introduction.ppt
OOP lesson1 and Variables.pdf
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
Different paradigms for problem solving.pptx
OOP CHAPTER object oreinted programming using c++
Object Oriented Language
6_Object-oriented-using-java.pdf object oriented programming concepts
SE-IT JAVA LAB OOP CONCEPT
Introduction to Object oriented Programming basics
CPP-Unit 1.pptx
UNIT - 1 Java Fundamentals, Basics of java
Ad

Recently uploaded (20)

PDF
Governor Volvo EC55 Service Repair Manual.pdf
PDF
Lubrication system for Automotive technologies
PDF
eti_09_TestPrecedurebdciwbwib wdjkcwnowe wdnwdw
PDF
6. Chapter Twenty_Managing Mass Communications Advertising Sales Promotions E...
PPTX
Independence_Day_Patriotic theme (1).pptx
PDF
book-slidefsdljflsk fdslkfjslf sflgs.pdf
PPTX
IOT-UNIT 3.pptxaaaasasasasasasaasasasasas
PPTX
diesel comman rail diesel comman hhh rail
PDF
Engine Volvo EC55 Compact Excavator Service Repair Manual.pdf
PDF
GMPL auto injector molding toollllllllllllllll
PPTX
Business Economics uni 1.pptxRTRETRETRTRETRETRETRETERT
PDF
System Diagrams John Deere 370E 410E 460E Repair Manual.pdf
PPTX
368455847-Relibility RJS-Relibility-PPT-1.pptx
PDF
Fuel injection pump Volvo EC55 Repair Manual.pdf
PPTX
Applications of SAP S4HANA in Mechanical by Sidhant Vohra (SET23A24040166).pptx
PDF
Pharmacy is a goood college yvucc7t7tvy7tv7t
PDF
John Deere 460E II Articulated Dump Truck Service Manual.pdf
PPTX
Victory precisions_Die casting foundry_.pptx
PPTX
Training Material_Verification Station.pptx
PDF
Cylinder head Volvo EC55 Service Repair Manual.pdf
Governor Volvo EC55 Service Repair Manual.pdf
Lubrication system for Automotive technologies
eti_09_TestPrecedurebdciwbwib wdjkcwnowe wdnwdw
6. Chapter Twenty_Managing Mass Communications Advertising Sales Promotions E...
Independence_Day_Patriotic theme (1).pptx
book-slidefsdljflsk fdslkfjslf sflgs.pdf
IOT-UNIT 3.pptxaaaasasasasasasaasasasasas
diesel comman rail diesel comman hhh rail
Engine Volvo EC55 Compact Excavator Service Repair Manual.pdf
GMPL auto injector molding toollllllllllllllll
Business Economics uni 1.pptxRTRETRETRTRETRETRETRETERT
System Diagrams John Deere 370E 410E 460E Repair Manual.pdf
368455847-Relibility RJS-Relibility-PPT-1.pptx
Fuel injection pump Volvo EC55 Repair Manual.pdf
Applications of SAP S4HANA in Mechanical by Sidhant Vohra (SET23A24040166).pptx
Pharmacy is a goood college yvucc7t7tvy7tv7t
John Deere 460E II Articulated Dump Truck Service Manual.pdf
Victory precisions_Die casting foundry_.pptx
Training Material_Verification Station.pptx
Cylinder head Volvo EC55 Service Repair Manual.pdf
Ad

OOPs Java Module 1.pptx marketing trends social media company profilesmarketing trends social media company profiles

  • 1. Module 1: FUNDAMENTALS OF OBJECT ORIENTED PROGRAMMING AND INTRODUCTION TO JAVA
  • 3. Procedural Languages 🔹 Definition: ● Procedural Programming is a programming paradigm based on procedure calls, where code is organized into functions or procedures. ● Focus: Emphasize a sequence of instructions (procedures or functions) to tell the computer what to do step-by- step. ● Structure: Programs are organized into a set of functions or subroutines. Data is often separate from the functions that operate on it. ● Data Handling: Data is typically passed around between functions. Global data might be used, leading to potential issues (see disadvantages below). ● Examples: C, Pascal, FORTRAN, COBOL.
  • 4. Characteristics of Procedural Programming: ● Top-Down Approach: The main program is broken down into smaller functions, each performing a specific task. ● Algorithms First: The primary focus is on designing the algorithms to solve a problem. ● Global Data: Data can often be accessed and modified by any function, leading to a "shared memory" model.
  • 5. Disadvantages of Procedural Programming : 1. Complexity with Large Programs: As programs grow, managing data flow between hundreds of functions becomes difficult. 2. Lack of Data Security/Integrity: Global data can be accidentally or maliciously modified by any function, leading to bugs that are hard to trace. 3. Difficult to Model Real-World Problems: Real-world entities have both properties (data) and behaviors (functions). Procedural languages separate these. 4. Poor Code Reusability: Functions are often specific to the data structures they operate on, making them less reusable in different contexts. 5. Maintainability Issues: Changes in data structures often require changes in many functions that access that data. 6. Concurrency Challenges: Managing shared global data in multi-threaded environments can lead to complex synchronization issues.
  • 6. Definition of OOP (Object-Oriented Programming) 🔹 What is OOP? ● OOP is a programming paradigm that uses objects and classes to structure code. ● It helps in modeling real-world entities like students, employees, cars, etc. 🔹 Origin: ● OOP concept was introduced with Simula (1960s). ● Popularized by C++, later Java, Python, C#, etc. 🔹 Key Principle: “Combine data and behavior into a single unit called object.”
  • 7. 🔶 Procedural Programming vs OOP Feature Procedural Programming Object-Oriented Programming (OOP) Focus Functions (procedures) Objects (data + behavior) Data Global/shared Encapsulated within objects Code Reusability Limited (via functions) High (via inheritance, polymorphism) Modularity Low High Real-World Modeling Difficult Natural and intuitive Maintainability Harder in large projects Easier and scalable
  • 9. Object 🔹 Definition: It's a real-world entity that has a state (values for its attributes) and behavior (actions it can perform or that can be performed on it) ● An object is a real-world entity that has: ○ State (data/attributes) ○ Behavior (functions/methods) ● It is a runtime instance of a class. Key Characteristics: ● It's a physical entity that exists in memory when the program runs. ● Each object has its own unique set of values for the attributes defined by its class. ● Objects communicate with each other by calling each other's methods. 🔹 Example: In Java: Dog d1= new Dog(); // d1 is an object
  • 10. Class ● Definition: A class is a blueprint, a template, or a prototype from which objects are created. It defines the structure (attributes/fields/properties) and behavior (methods/functions) that all objects of that class will have. Key Characteristics: ● It's a logical entity, not a physical one (it doesn't consume memory when defined, only when objects are created from it). ● It acts as a user-defined data type. ● It defines the state (data/attributes) and behavior (methods) that its objects will possess.
  • 11. Class Example : class Dog { // This is the class definition // Attributes (State) String name; String breed; int age; // Methods (Behavior) void bark() { System.out.println(name + " says Woof!"); } void eat() { System.out.println(name + " is eating."); } }
  • 12. Data Abstraction 🔹 Definition: ● Abstraction means showing only the essential features and hiding the complex implementation details. ● Focuses on what an object does, not how it does it. 🔹 Benefits: ● Simplicity ● Focus on relevant details ● Improved security
  • 13. Data Encapsulation 🔹 Definition: ● Encapsulation is the process of binding data and methods that operate on that data into a single unit (class). ● It protects data by making variables private and exposing methods as public. Benefits: ● Prevents unauthorized access ● Better control of data ● Easy maintenance and testing
  • 14. Data Hiding 🔹 Definition: ● Data hiding means restricting access to internal object details (like variables). ● Achieved using access modifiers: private, protected, public. ● Only specific parts of code (usually within the same class) can access hidden data. Member Functions 🔹 Definition: ● Functions (methods) defined inside a class are called member functions. ● Used to operate on data members (variables).
  • 15. Reusability 🔹 Definition: ● OOP allows you to reuse code by creating reusable classes, especially using inheritance. ● Reduces redundancy and speeds up development. Inheritance 🔹 Definition: ● Inheritance allows a class (child/subclass) to inherit features (variables and methods) from another class (parent/superclass). ● Single, Multiple and Hierarchical inheritance
  • 16. Creating New Data Types 🔹 What it Means: ● In OOP, you can define your own data types using classes. ● These types combine attributes and behaviors into a single structure. Example: class Book { String title; String author; double price; void display() { System.out.println(title + " by " + author + " costs " + price); } }
  • 17. Polymorphism 🔹 Definition: ● Polymorphism means “many forms”. ● It allows the same function name to behave differently depending on the object or context. ● Compile time and Run time polymorphism Overloading (Compile-time Polymorphism) 🔹 Definition: ● Same method name with different parameters. Dynamic Binding (Run-time Polymorphism) 🔹 Definition: ● Method to be called is decided at runtime, using inheritance and overriding.
  • 18. Message Passing 🔹 Definition: ● Objects communicate with each other by calling methods. ● This is called message passing. 🔹 Example: car.start(); // 'start' is the message sent to the object 'car' 🧠 Object car receives a message (method call) and responds by executing the method.
  • 19. 1. Modularity 2. Reusability 3. Encapsulation 4. Abstraction 5. Easy Maintenance 6. Polymorphism 7. Scalability and Productivity 8. Improved Software Development Lifecycle Benefits of Object-Oriented Programming (OOP)
  • 20. Applications of OOP (in Points) 1. 🎮 Game Development ○ Objects represent players, enemies, weapons, scores, etc. 2. 📱 Mobile Application Development ○ Android (Java/Kotlin) and iOS (Swift) apps use OOP extensively. 3. ️ 🖥️Desktop GUI Applications ○ Tools like Java Swing, JavaFX, .NET use objects for buttons, forms, dialogs. 4. 🌐 Web Development (Backend) ○ Languages like PHP, Python (Django), Java (Spring), and Node.js apply OOP for server-side logic. 5. 🧠 Artificial Intelligence & Machine Learning ○ OOP helps structure complex algorithms and data pipelines into reusable modules. 6. 🧪 Scientific and Engineering Applications ○ Simulation, modeling systems, and design tools benefit from modular OOP design. 7. 🛒 E-Commerce Platforms ○ Manage products, users, carts, orders using object-oriented design. 8. 🏥 Healthcare Systems ○ Represent patients, records, appointments, prescriptions as objects. 9. ️ 🛠️System Software & Tools ○ Operating system modules, compilers, interpreters use OOP. 10. ️ 🗃️Database Management Systems ● ORM tools like Hibernate and Sequelize map database tables to objects.