SlideShare a Scribd company logo
1 of 13
Object Oriented Programming System
Object Oriented Programming is a methodology to design a
program using Classes and Objects.
It simplifies the software development and maintenance by
providing some concepts:
 Object
 Class
 Inheritance
 Polymorphism
 Abstraction
 Encapsulation
OBJECT
A runtime entity that has state and behavior is known as Object.
Object= data + method ,Object is an instance of a class.
An object has these characteristics:
State: represents the data of an Object.
Behavior: represents the behavior of an Object.
Identity: object is typically implemented via a unique ID.
Real time Example:
CLASS
A Class is a group of objects that have common property.
(or)
Collection of Objects.
It is a Template or Blue Print from which objects are created.
Syntax to declare a Class:
Class <class name>
{
data member;
method;
}
Example for Class and Object:
Class student
{
String name = “DineshKumar”;
int phoneno = “9500012345”;
public static void main( string[] args)
{
Student s1 = new student(); // object
System.out.println(“Name is:” +s1.name);
System.out.println(“Phone No:” +s1.phoneno);
}
}
Output:
Name is: DineshKumar
Phone No: 9500012345
ABSTRACTION
Abstraction is a process of hiding the implementation details
and showing only functionality to the user.
(OR)
It highlights the essential things to the user and hides
the non- essential things.
Real Time Example:
Sending SMS: you just type the text and send the message
you don’t know the internal processing about message delivery.
Syntax to declare the abstract class:
Abstract class < class- name>
{
}
INTERFACE
An Interface is a blue print of a class; it has static constants and
abstract methods.
Interface is used to achieve fully abstraction
and Multiple Inheritances in Java.
An implement is a keyword to implement
the interface in a class.
Java does not support multiple inheritance.
Multiple Inheritance is not supported in case of class but it is
supported in case of interface because there is no ambiguity as
implementation is provided by the implementation class.
ENCAPSULATION
Encapsulation is a process of wrapping code and Data together
into a single unit.
We can calculate a fully encapsulated class by making all the data
members of the class private now we can use setter and getter
methods to set and get the data in it.
In a encapsulated class we can access only the methods
we can’t able to access the data that scenario is called Data Hiding.
Data’s
Method’s
INHERITANCE
Inheritance is a mechanism in which one object acquires and the
properties and behaviors of parent class. A new class derived from
old class.
Syntax for Inheritance:
class subclass name extends super class name
{
}
extends is a key word is used to inherit one class for another class.
To reduce the complexity and simplify the language, multiple
interfaces are not supported in Java.
POLYMORPHISM
In general polymorphism is a particular thing behave
differently in a different situation
Two types of Polymorphism:
Compile time Polymorphism
Run time Polymorphism
Run time Polymorphism Example: Method Overloading.
Compile time Polymorphism Example: Method Overriding.
Real time Example:
Mobile Phone: It acts like a phone where you calling to
someone.
It acts like a camera whiles you taking a snap.
It acts like a Music player whiles you hearing song from that.
Run time Polymorphism
Method overloading:
Method having same name but difference
in the number of arguments and its data type.
Example:
Sum( int a, int b)
Sum( int a, int b, int c)
Sum( float a, float b)
Sum( float a, float b, float c)
For example the entire method names are same but the main
difference in the number of arguments and its data type.
Compile Time Polymorphism
Method Overriding:
Method having same name, same number of arguments and its
data type.
overriding method MUST have the same argument list (if not, it
might be a case of overloading)
overriding method MUST have the same return type; the
exception is covariant return (used as of Java 5) which returns a
type that is a subclass of what is returned by the over riden
method
Basics of oops concept

More Related Content

What's hot

Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: DemystifiedSeth McLaughlin
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScriptNascenia IT
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)slire
 
OOP interview questions & answers.
OOP interview questions & answers.OOP interview questions & answers.
OOP interview questions & answers.Questpond
 
The Kotlin Programming Language
The Kotlin Programming LanguageThe Kotlin Programming Language
The Kotlin Programming Languageintelliyole
 
JavaScript Conditional Statements
JavaScript Conditional StatementsJavaScript Conditional Statements
JavaScript Conditional StatementsMarlon Jamera
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascriptDoeun KOCH
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop Kumar
 
Core java concepts
Core java  conceptsCore java  concepts
Core java conceptsRam132
 
Programmazione funzionale e Stream in Java
Programmazione funzionale e Stream in JavaProgrammazione funzionale e Stream in Java
Programmazione funzionale e Stream in JavaCristina Attori
 
Object Oriented Programming ppt presentation
Object Oriented Programming ppt presentationObject Oriented Programming ppt presentation
Object Oriented Programming ppt presentationAyanaRukasar
 
Learn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & LoopsLearn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & LoopsEng Teong Cheah
 

What's hot (20)

Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: Demystified
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
 
OOP interview questions & answers.
OOP interview questions & answers.OOP interview questions & answers.
OOP interview questions & answers.
 
The Kotlin Programming Language
The Kotlin Programming LanguageThe Kotlin Programming Language
The Kotlin Programming Language
 
Angularjs PPT
Angularjs PPTAngularjs PPT
Angularjs PPT
 
JavaScript Conditional Statements
JavaScript Conditional StatementsJavaScript Conditional Statements
JavaScript Conditional Statements
 
JQuery UI
JQuery UIJQuery UI
JQuery UI
 
Typescript ppt
Typescript pptTypescript ppt
Typescript ppt
 
Javascript functions
Javascript functionsJavascript functions
Javascript functions
 
07 java variables
07   java variables07   java variables
07 java variables
 
JPA and Hibernate
JPA and HibernateJPA and Hibernate
JPA and Hibernate
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascript
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop
 
Core java concepts
Core java  conceptsCore java  concepts
Core java concepts
 
Programmazione funzionale e Stream in Java
Programmazione funzionale e Stream in JavaProgrammazione funzionale e Stream in Java
Programmazione funzionale e Stream in Java
 
Object Oriented Programming ppt presentation
Object Oriented Programming ppt presentationObject Oriented Programming ppt presentation
Object Oriented Programming ppt presentation
 
TypeScript - An Introduction
TypeScript - An IntroductionTypeScript - An Introduction
TypeScript - An Introduction
 
Learn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & LoopsLearn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & Loops
 
Getting started with typescript
Getting started with typescriptGetting started with typescript
Getting started with typescript
 

Viewers also liked

Concepts of OOPs
Concepts of OOPsConcepts of OOPs
Concepts of OOPsEssay Corp
 
OOPS features using Objective C
OOPS features using Objective COOPS features using Objective C
OOPS features using Objective CTiyasi Acharya
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
OOP Chapter 8 : Inheritance
OOP Chapter 8 : InheritanceOOP Chapter 8 : Inheritance
OOP Chapter 8 : InheritanceAtit Patumvan
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).pptAlok Kumar
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language Mohamed Loey
 
01 c++ Intro.ppt
01 c++ Intro.ppt01 c++ Intro.ppt
01 c++ Intro.pptTareq Hasan
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating systemSalma Begum
 

Viewers also liked (15)

Concepts of OOPs
Concepts of OOPsConcepts of OOPs
Concepts of OOPs
 
OOPS features using Objective C
OOPS features using Objective COOPS features using Objective C
OOPS features using Objective C
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Android Operating System Architecture
Android Operating System ArchitectureAndroid Operating System Architecture
Android Operating System Architecture
 
Total oop in c# dot net
Total oop in c# dot netTotal oop in c# dot net
Total oop in c# dot net
 
OOP Chapter 8 : Inheritance
OOP Chapter 8 : InheritanceOOP Chapter 8 : Inheritance
OOP Chapter 8 : Inheritance
 
Oops concept on c#
Oops concept on c#Oops concept on c#
Oops concept on c#
 
Intro to C++ - language
Intro to C++ - languageIntro to C++ - language
Intro to C++ - language
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language
 
01 c++ Intro.ppt
01 c++ Intro.ppt01 c++ Intro.ppt
01 c++ Intro.ppt
 
Oops ppt
Oops pptOops ppt
Oops ppt
 
C++ ppt
C++ pptC++ ppt
C++ ppt
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating system
 

Similar to Basics of oops concept

Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshowilias ahmed
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP conceptsAhmed Farag
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingFahad Abbasi
 
Selenium Training .pptx
Selenium Training .pptxSelenium Training .pptx
Selenium Training .pptxSajidTk2
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Languagedheva B
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptxRaazIndia
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxKunalYadav65140
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introductionsandeep54552
 
oopsinvb-191021101327.pdf
oopsinvb-191021101327.pdfoopsinvb-191021101327.pdf
oopsinvb-191021101327.pdfJP Chicano
 
Nitish Chaulagai Java1.pptx
Nitish Chaulagai Java1.pptxNitish Chaulagai Java1.pptx
Nitish Chaulagai Java1.pptxNitishChaulagai
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaMadishetty Prathibha
 
Question and answer Programming
Question and answer ProgrammingQuestion and answer Programming
Question and answer ProgrammingInocentshuja Ahmad
 

Similar to Basics of oops concept (20)

JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
 
Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshow
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Selenium Training .pptx
Selenium Training .pptxSelenium Training .pptx
Selenium Training .pptx
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
 
ANDROID FDP PPT
ANDROID FDP PPTANDROID FDP PPT
ANDROID FDP PPT
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptx
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptx
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introduction
 
Oops
OopsOops
Oops
 
oopsinvb-191021101327.pdf
oopsinvb-191021101327.pdfoopsinvb-191021101327.pdf
oopsinvb-191021101327.pdf
 
Oops in vb
Oops in vbOops in vb
Oops in vb
 
Nitish Chaulagai Java1.pptx
Nitish Chaulagai Java1.pptxNitish Chaulagai Java1.pptx
Nitish Chaulagai Java1.pptx
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
 
Unit 1 Java
Unit 1 JavaUnit 1 Java
Unit 1 Java
 
Question and answer Programming
Question and answer ProgrammingQuestion and answer Programming
Question and answer Programming
 
SEMINAR
SEMINARSEMINAR
SEMINAR
 
Seminar
SeminarSeminar
Seminar
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Basics of oops concept

  • 1.
  • 2. Object Oriented Programming System Object Oriented Programming is a methodology to design a program using Classes and Objects. It simplifies the software development and maintenance by providing some concepts:  Object  Class  Inheritance  Polymorphism  Abstraction  Encapsulation
  • 3. OBJECT A runtime entity that has state and behavior is known as Object. Object= data + method ,Object is an instance of a class. An object has these characteristics: State: represents the data of an Object. Behavior: represents the behavior of an Object. Identity: object is typically implemented via a unique ID. Real time Example:
  • 4. CLASS A Class is a group of objects that have common property. (or) Collection of Objects. It is a Template or Blue Print from which objects are created. Syntax to declare a Class: Class <class name> { data member; method; }
  • 5. Example for Class and Object: Class student { String name = “DineshKumar”; int phoneno = “9500012345”; public static void main( string[] args) { Student s1 = new student(); // object System.out.println(“Name is:” +s1.name); System.out.println(“Phone No:” +s1.phoneno); } } Output: Name is: DineshKumar Phone No: 9500012345
  • 6. ABSTRACTION Abstraction is a process of hiding the implementation details and showing only functionality to the user. (OR) It highlights the essential things to the user and hides the non- essential things. Real Time Example: Sending SMS: you just type the text and send the message you don’t know the internal processing about message delivery. Syntax to declare the abstract class: Abstract class < class- name> { }
  • 7. INTERFACE An Interface is a blue print of a class; it has static constants and abstract methods. Interface is used to achieve fully abstraction and Multiple Inheritances in Java. An implement is a keyword to implement the interface in a class. Java does not support multiple inheritance. Multiple Inheritance is not supported in case of class but it is supported in case of interface because there is no ambiguity as implementation is provided by the implementation class.
  • 8. ENCAPSULATION Encapsulation is a process of wrapping code and Data together into a single unit. We can calculate a fully encapsulated class by making all the data members of the class private now we can use setter and getter methods to set and get the data in it. In a encapsulated class we can access only the methods we can’t able to access the data that scenario is called Data Hiding. Data’s Method’s
  • 9. INHERITANCE Inheritance is a mechanism in which one object acquires and the properties and behaviors of parent class. A new class derived from old class. Syntax for Inheritance: class subclass name extends super class name { } extends is a key word is used to inherit one class for another class. To reduce the complexity and simplify the language, multiple interfaces are not supported in Java.
  • 10. POLYMORPHISM In general polymorphism is a particular thing behave differently in a different situation Two types of Polymorphism: Compile time Polymorphism Run time Polymorphism Run time Polymorphism Example: Method Overloading. Compile time Polymorphism Example: Method Overriding. Real time Example: Mobile Phone: It acts like a phone where you calling to someone. It acts like a camera whiles you taking a snap. It acts like a Music player whiles you hearing song from that.
  • 11. Run time Polymorphism Method overloading: Method having same name but difference in the number of arguments and its data type. Example: Sum( int a, int b) Sum( int a, int b, int c) Sum( float a, float b) Sum( float a, float b, float c) For example the entire method names are same but the main difference in the number of arguments and its data type.
  • 12. Compile Time Polymorphism Method Overriding: Method having same name, same number of arguments and its data type. overriding method MUST have the same argument list (if not, it might be a case of overloading) overriding method MUST have the same return type; the exception is covariant return (used as of Java 5) which returns a type that is a subclass of what is returned by the over riden method