SlideShare a Scribd company logo
Introduction to oop
What is OOP?
• OOP is a design philosophy. It stands for Object Oriented
Programming. Object-Oriented Programming (OOP) uses a different
set of programming languages than old procedural programming
languages (C, Pascal, etc.). Everything in OOP is grouped as self
sustainable "objects". Hence, you gain reusability by means of four
main object-oriented programming concepts.
• In order to clearly understand the object orientation model, let’s
take your “hand” as an example. The “hand” is a class. Your body
has two objects of the type "hand", named "left hand" and "right
hand". Their main functions are controlled or managed by a set of
electrical signals sent through your shoulders (through an
interface). So the shoulder is an interface that your body uses to
interact with your hands. The hand is a well-architected class. The
hand is being reused to create the left hand and the right hand by
slightly changing the properties of it.
What is an Object?
• An object can be considered a "thing" that can
perform a set of related activities. The set of
activities that the object performs defines the
object's behavior. For example,
the Hand (object) can grip something, or
a Student(object) can give their name or
address.
• In pure OOP terms an object is an instance of
a class.
What is a Class?
• A class is simply a representation of a type of object. It is
the blueprint, or plan, or template, that describes the
details of an object. A class is the blueprint from which the
individual objects are created. Class is composed of three
things: a name, attributes, and operations.
• public class Student {
}
• According to the sample given below we can say that
the Student object, named objectStudent, has been
created out of the Student class.
• Student objectStudent = new Student();
Introduction to oop
classes
• In order to manage the classes of a software
system, and to reduce the complexity, system
designers use several techniques, which can
be grouped under four main concepts named
• 1. Encapsulation
• 2. Abstraction
• 3. Inheritance
• 4. Polymorphism.
What is Encapsulation (or Information
Hiding)?
• The encapsulation is the inclusion-within a program object-of
all the resources needed for the object to function, basically,
the methods and the data.
• In OOP the encapsulation is mainly achieved by creating
classes, the classes expose public methods and properties.
• A class is kind of a container or capsule or a cell, which
encapsulate a set of methods, attribute and properties to
provide its indented functionalities to other classes. In that
sense, encapsulation also allows a class to change its internal
implementation without hurting the overall functioning of the
system.
• That idea of encapsulation is to hide how a class does its
business, while allowing other classes to make requests of it.
What is Abstraction
• Abstraction is an emphasis on the idea, qualities and
properties rather than the particulars (a suppression of
detail). The importance of abstraction is derived from
its ability to hide irrelevant details and from the use of
names to reference objects.
• Abstraction is essential in the construction of
programs. It places the emphasis on what an object is
or does rather than how it is represented or how it
works. Thus, it is the primary means of managing
complexity in large programs.
• While abstraction reduces complexity by hiding
irrelevant detail
What is an Abstract class?
• Abstract classes, which declared with the abstract keyword,
cannot be instantiated. It can only be used as a super-class
for other classes that extend the abstract class.
• Abstract class is the concept and implementation gets
completed when it is being realized by a subclass. In
addition to this a class can inherit only from one abstract
class (but a class may implement many interfaces) and and
must override all its methods/properties that are declared
to be abstract and may override virtual methods/
properties.
• Abstract classes are ideal when implementing frameworks.
What is an Interface?
• Interface can be used to define a generic template and then one or
more abstract classes to define partial implementations of the
interface. Interfaces just specify the method declaration (implicitly
public and abstract) and can contain properties (which are also
implicitly public and abstract).
• Interface definition begins with the keyword interface. An interface
like that of an abstract class cannot be instantiated.
• If a class that implements an interface does not define all the
methods of the interface, then it must be declared abstract and the
method definitions must be provided by the subclass that extends
the abstract class. In addition to this an interfaces can inherit other
interfaces.
• public interface ILogger {
• bool IsThisLogError { get; } }
What is Polymorphism?
• Polymorphisms is a generic term that means
'many shapes'. More
precisely Polymorphisms means the ability to
request that the same operations be performed
by a wide range of different types of things.
• In OOP the polymorphisms is achieved by using
many different techniques named method
overloading, operator overloading, and method
overriding,
What is Method Overloading?
• Method overloading is the ability to define several methods all with the
same name.
• public class MyLogger
{
public void LogError(Exception e)
{
// Implementation goes here
}
public bool LogError(Exception e, string message)
{
// Implementation goes here
}
}
What is Method Overriding?
• Method overriding is a language feature that
allows a subclass to override a specific
implementation of a method that is already
provided by one of its super-classes.
• A subclass can give its own definition of methods
but need to have the same signature and same
name as the method in its super-class. This
means that when overriding a method the
subclass's method has to have the same name
and parameter list as the super-class' overridden
method.
example
• using System;
public class Complex
{
private int real;
public int Real
{ get { return real; } }
private int imaginary;
public int Imaginary
{ get { return imaginary; } }
public Complex(int real, int imaginary)
{
this.real = real;
this.imaginary = imaginary;
}
public static Complex operator +(Complex c1, Complex c2)
{
return new Complex(c1.Real + c2.Real, c1.Imaginary + c2.Imaginary);
}
public override string ToString()
{
return (String.Format("{0} + {1}i", real, imaginary));
}}
Access modifiers
• public
• The type or member can be accessed by any other
code in the same class or another class that references
it.
• private
• The type or member can only be accessed by code in
the same class or struct.
• protected
• The type or member can only be accessed by code in
the same class or struct, or in a derived class.
Access modifier
• Static
• The static modifier on a class means that the class
cannot be instantiated, and that all of its members are
static. A static member has one version regardless of
how many instances of its enclosing type are created.
• A static class is basically the same as a non-static class,
but there is one difference: a static class cannot be
externally instantiated. In other words, you cannot use
the new keyword to create a variable of the class type.
Because there is no instance variable, you access the
members of a static class by using the class name itself.
Ad

More Related Content

What's hot (20)

Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
thinkphp
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
Oops ppt
Oops pptOops ppt
Oops ppt
abhayjuneja
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
Pritom Chaki
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
Abhilash Nair
 
OOPS in Java
OOPS in JavaOOPS in Java
OOPS in Java
Zeeshan Khan
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
Moutaz Haddara
 
OOP Introduction with java programming language
OOP Introduction with java programming languageOOP Introduction with java programming language
OOP Introduction with java programming language
Md.Al-imran Roton
 
[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP
Muhammad Hammad Waseem
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
daxesh chauhan
 
Chapter 05 classes and objects
Chapter 05 classes and objectsChapter 05 classes and objects
Chapter 05 classes and objects
Praveen M Jigajinni
 
Object-oriented Programming-with C#
Object-oriented Programming-with C#Object-oriented Programming-with C#
Object-oriented Programming-with C#
Doncho Minkov
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
Muhammad Waqas
 
class and objects
class and objectsclass and objects
class and objects
Payel Guria
 
Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners
Vibhawa Nirmal
 
Procedural vs. object oriented programming
Procedural vs. object oriented programmingProcedural vs. object oriented programming
Procedural vs. object oriented programming
Haris Bin Zahid
 
OOPS Basics With Example
OOPS Basics With ExampleOOPS Basics With Example
OOPS Basics With Example
Thooyavan Venkatachalam
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
Tech_MX
 
OOP concepts -in-Python programming language
OOP concepts -in-Python programming languageOOP concepts -in-Python programming language
OOP concepts -in-Python programming language
SmritiSharma901052
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
thinkphp
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
Pritom Chaki
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
Abhilash Nair
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
Moutaz Haddara
 
OOP Introduction with java programming language
OOP Introduction with java programming languageOOP Introduction with java programming language
OOP Introduction with java programming language
Md.Al-imran Roton
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
daxesh chauhan
 
Object-oriented Programming-with C#
Object-oriented Programming-with C#Object-oriented Programming-with C#
Object-oriented Programming-with C#
Doncho Minkov
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
Muhammad Waqas
 
class and objects
class and objectsclass and objects
class and objects
Payel Guria
 
Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners
Vibhawa Nirmal
 
Procedural vs. object oriented programming
Procedural vs. object oriented programmingProcedural vs. object oriented programming
Procedural vs. object oriented programming
Haris Bin Zahid
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
Tech_MX
 
OOP concepts -in-Python programming language
OOP concepts -in-Python programming languageOOP concepts -in-Python programming language
OOP concepts -in-Python programming language
SmritiSharma901052
 

Similar to Introduction to oop (20)

oop.pptx
oop.pptxoop.pptx
oop.pptx
KabitaParajuli3
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
MH Abid
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
Geophery sanga
 
Python programming Concepts (Functions, classes and Oops concept
Python programming Concepts (Functions, classes and Oops conceptPython programming Concepts (Functions, classes and Oops concept
Python programming Concepts (Functions, classes and Oops concept
Lipika Sharma
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
baabtra.com - No. 1 supplier of quality freshers
 
Pi j3.2 polymorphism
Pi j3.2 polymorphismPi j3.2 polymorphism
Pi j3.2 polymorphism
mcollison
 
Object Oriented Programming (OOP) Introduction
Object Oriented Programming (OOP) IntroductionObject Oriented Programming (OOP) Introduction
Object Oriented Programming (OOP) Introduction
SamuelAnsong6
 
My c++
My c++My c++
My c++
snathick
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Saiful Islam Sany
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
AnmolVerma363503
 
Lesson 13 object and class
Lesson 13 object and classLesson 13 object and class
Lesson 13 object and class
MLG College of Learning, Inc
 
Php oop (1)
Php oop (1)Php oop (1)
Php oop (1)
Sudip Simkhada
 
C++ first s lide
C++ first s lideC++ first s lide
C++ first s lide
Sudhriti Gupta
 
Md02 - Getting Started part-2
Md02 - Getting Started part-2Md02 - Getting Started part-2
Md02 - Getting Started part-2
Rakesh Madugula
 
OOPS – General Understanding in .NET
OOPS – General Understanding in .NETOOPS – General Understanding in .NET
OOPS – General Understanding in .NET
Sabith Byari
 
Abstraction encapsulation inheritance polymorphism
Abstraction encapsulation inheritance polymorphismAbstraction encapsulation inheritance polymorphism
Abstraction encapsulation inheritance polymorphism
PriyadharshiniG41
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
Ahmed Farag
 
EEE oops Vth semester viva questions with answer
EEE oops Vth semester viva questions with answerEEE oops Vth semester viva questions with answer
EEE oops Vth semester viva questions with answer
Jeba Moses
 
c++.pptxwjwjsijsnsksomammaoansnksooskskk
c++.pptxwjwjsijsnsksomammaoansnksooskskkc++.pptxwjwjsijsnsksomammaoansnksooskskk
c++.pptxwjwjsijsnsksomammaoansnksooskskk
mitivete
 
Abstraction in java [abstract classes and Interfaces
Abstraction in java [abstract classes and InterfacesAbstraction in java [abstract classes and Interfaces
Abstraction in java [abstract classes and Interfaces
Ahmed Nobi
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
MH Abid
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
Geophery sanga
 
Python programming Concepts (Functions, classes and Oops concept
Python programming Concepts (Functions, classes and Oops conceptPython programming Concepts (Functions, classes and Oops concept
Python programming Concepts (Functions, classes and Oops concept
Lipika Sharma
 
Pi j3.2 polymorphism
Pi j3.2 polymorphismPi j3.2 polymorphism
Pi j3.2 polymorphism
mcollison
 
Object Oriented Programming (OOP) Introduction
Object Oriented Programming (OOP) IntroductionObject Oriented Programming (OOP) Introduction
Object Oriented Programming (OOP) Introduction
SamuelAnsong6
 
Md02 - Getting Started part-2
Md02 - Getting Started part-2Md02 - Getting Started part-2
Md02 - Getting Started part-2
Rakesh Madugula
 
OOPS – General Understanding in .NET
OOPS – General Understanding in .NETOOPS – General Understanding in .NET
OOPS – General Understanding in .NET
Sabith Byari
 
Abstraction encapsulation inheritance polymorphism
Abstraction encapsulation inheritance polymorphismAbstraction encapsulation inheritance polymorphism
Abstraction encapsulation inheritance polymorphism
PriyadharshiniG41
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
Ahmed Farag
 
EEE oops Vth semester viva questions with answer
EEE oops Vth semester viva questions with answerEEE oops Vth semester viva questions with answer
EEE oops Vth semester viva questions with answer
Jeba Moses
 
c++.pptxwjwjsijsnsksomammaoansnksooskskk
c++.pptxwjwjsijsnsksomammaoansnksooskskkc++.pptxwjwjsijsnsksomammaoansnksooskskk
c++.pptxwjwjsijsnsksomammaoansnksooskskk
mitivete
 
Abstraction in java [abstract classes and Interfaces
Abstraction in java [abstract classes and InterfacesAbstraction in java [abstract classes and Interfaces
Abstraction in java [abstract classes and Interfaces
Ahmed Nobi
 
Ad

More from colleges (6)

introduction to machine learning
introduction to machine learningintroduction to machine learning
introduction to machine learning
colleges
 
searching
searchingsearching
searching
colleges
 
searching technique
searching techniquesearching technique
searching technique
colleges
 
Automata theory
Automata theoryAutomata theory
Automata theory
colleges
 
Introduction to web architecture
Introduction to web architectureIntroduction to web architecture
Introduction to web architecture
colleges
 
Enterprise application development
Enterprise application developmentEnterprise application development
Enterprise application development
colleges
 
introduction to machine learning
introduction to machine learningintroduction to machine learning
introduction to machine learning
colleges
 
searching technique
searching techniquesearching technique
searching technique
colleges
 
Automata theory
Automata theoryAutomata theory
Automata theory
colleges
 
Introduction to web architecture
Introduction to web architectureIntroduction to web architecture
Introduction to web architecture
colleges
 
Enterprise application development
Enterprise application developmentEnterprise application development
Enterprise application development
colleges
 
Ad

Recently uploaded (20)

Buy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training techBuy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training tech
Rustici Software
 
Beyond the code. Complexity - 2025.05 - SwiftCraft
Beyond the code. Complexity - 2025.05 - SwiftCraftBeyond the code. Complexity - 2025.05 - SwiftCraft
Beyond the code. Complexity - 2025.05 - SwiftCraft
Dmitrii Ivanov
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Best HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRMBest HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRM
accordHRM
 
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studiesTroubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Tier1 app
 
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business StageA Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
SynapseIndia
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?
HireME
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World ExamplesMastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
The Elixir Developer - All Things Open
The Elixir Developer - All Things OpenThe Elixir Developer - All Things Open
The Elixir Developer - All Things Open
Carlo Gilmar Padilla Santana
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
Gojek Clone App for Multi-Service Business
Gojek Clone App for Multi-Service BusinessGojek Clone App for Multi-Service Business
Gojek Clone App for Multi-Service Business
XongoLab Technologies LLP
 
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEMGDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
philipnathen82
 
Adobe Media Encoder Crack FREE Download 2025
Adobe Media Encoder  Crack FREE Download 2025Adobe Media Encoder  Crack FREE Download 2025
Adobe Media Encoder Crack FREE Download 2025
zafranwaqar90
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by AjathMobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Ajath Infotech Technologies LLC
 
Buy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training techBuy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training tech
Rustici Software
 
Beyond the code. Complexity - 2025.05 - SwiftCraft
Beyond the code. Complexity - 2025.05 - SwiftCraftBeyond the code. Complexity - 2025.05 - SwiftCraft
Beyond the code. Complexity - 2025.05 - SwiftCraft
Dmitrii Ivanov
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Best HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRMBest HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRM
accordHRM
 
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studiesTroubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Tier1 app
 
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business StageA Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
SynapseIndia
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?
HireME
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World ExamplesMastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEMGDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
philipnathen82
 
Adobe Media Encoder Crack FREE Download 2025
Adobe Media Encoder  Crack FREE Download 2025Adobe Media Encoder  Crack FREE Download 2025
Adobe Media Encoder Crack FREE Download 2025
zafranwaqar90
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by AjathMobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Ajath Infotech Technologies LLC
 

Introduction to oop

  • 2. What is OOP? • OOP is a design philosophy. It stands for Object Oriented Programming. Object-Oriented Programming (OOP) uses a different set of programming languages than old procedural programming languages (C, Pascal, etc.). Everything in OOP is grouped as self sustainable "objects". Hence, you gain reusability by means of four main object-oriented programming concepts. • In order to clearly understand the object orientation model, let’s take your “hand” as an example. The “hand” is a class. Your body has two objects of the type "hand", named "left hand" and "right hand". Their main functions are controlled or managed by a set of electrical signals sent through your shoulders (through an interface). So the shoulder is an interface that your body uses to interact with your hands. The hand is a well-architected class. The hand is being reused to create the left hand and the right hand by slightly changing the properties of it.
  • 3. What is an Object? • An object can be considered a "thing" that can perform a set of related activities. The set of activities that the object performs defines the object's behavior. For example, the Hand (object) can grip something, or a Student(object) can give their name or address. • In pure OOP terms an object is an instance of a class.
  • 4. What is a Class? • A class is simply a representation of a type of object. It is the blueprint, or plan, or template, that describes the details of an object. A class is the blueprint from which the individual objects are created. Class is composed of three things: a name, attributes, and operations. • public class Student { } • According to the sample given below we can say that the Student object, named objectStudent, has been created out of the Student class. • Student objectStudent = new Student();
  • 6. classes • In order to manage the classes of a software system, and to reduce the complexity, system designers use several techniques, which can be grouped under four main concepts named • 1. Encapsulation • 2. Abstraction • 3. Inheritance • 4. Polymorphism.
  • 7. What is Encapsulation (or Information Hiding)? • The encapsulation is the inclusion-within a program object-of all the resources needed for the object to function, basically, the methods and the data. • In OOP the encapsulation is mainly achieved by creating classes, the classes expose public methods and properties. • A class is kind of a container or capsule or a cell, which encapsulate a set of methods, attribute and properties to provide its indented functionalities to other classes. In that sense, encapsulation also allows a class to change its internal implementation without hurting the overall functioning of the system. • That idea of encapsulation is to hide how a class does its business, while allowing other classes to make requests of it.
  • 8. What is Abstraction • Abstraction is an emphasis on the idea, qualities and properties rather than the particulars (a suppression of detail). The importance of abstraction is derived from its ability to hide irrelevant details and from the use of names to reference objects. • Abstraction is essential in the construction of programs. It places the emphasis on what an object is or does rather than how it is represented or how it works. Thus, it is the primary means of managing complexity in large programs. • While abstraction reduces complexity by hiding irrelevant detail
  • 9. What is an Abstract class? • Abstract classes, which declared with the abstract keyword, cannot be instantiated. It can only be used as a super-class for other classes that extend the abstract class. • Abstract class is the concept and implementation gets completed when it is being realized by a subclass. In addition to this a class can inherit only from one abstract class (but a class may implement many interfaces) and and must override all its methods/properties that are declared to be abstract and may override virtual methods/ properties. • Abstract classes are ideal when implementing frameworks.
  • 10. What is an Interface? • Interface can be used to define a generic template and then one or more abstract classes to define partial implementations of the interface. Interfaces just specify the method declaration (implicitly public and abstract) and can contain properties (which are also implicitly public and abstract). • Interface definition begins with the keyword interface. An interface like that of an abstract class cannot be instantiated. • If a class that implements an interface does not define all the methods of the interface, then it must be declared abstract and the method definitions must be provided by the subclass that extends the abstract class. In addition to this an interfaces can inherit other interfaces. • public interface ILogger { • bool IsThisLogError { get; } }
  • 11. What is Polymorphism? • Polymorphisms is a generic term that means 'many shapes'. More precisely Polymorphisms means the ability to request that the same operations be performed by a wide range of different types of things. • In OOP the polymorphisms is achieved by using many different techniques named method overloading, operator overloading, and method overriding,
  • 12. What is Method Overloading? • Method overloading is the ability to define several methods all with the same name. • public class MyLogger { public void LogError(Exception e) { // Implementation goes here } public bool LogError(Exception e, string message) { // Implementation goes here } }
  • 13. What is Method Overriding? • Method overriding is a language feature that allows a subclass to override a specific implementation of a method that is already provided by one of its super-classes. • A subclass can give its own definition of methods but need to have the same signature and same name as the method in its super-class. This means that when overriding a method the subclass's method has to have the same name and parameter list as the super-class' overridden method.
  • 14. example • using System; public class Complex { private int real; public int Real { get { return real; } } private int imaginary; public int Imaginary { get { return imaginary; } } public Complex(int real, int imaginary) { this.real = real; this.imaginary = imaginary; } public static Complex operator +(Complex c1, Complex c2) { return new Complex(c1.Real + c2.Real, c1.Imaginary + c2.Imaginary); } public override string ToString() { return (String.Format("{0} + {1}i", real, imaginary)); }}
  • 15. Access modifiers • public • The type or member can be accessed by any other code in the same class or another class that references it. • private • The type or member can only be accessed by code in the same class or struct. • protected • The type or member can only be accessed by code in the same class or struct, or in a derived class.
  • 16. Access modifier • Static • The static modifier on a class means that the class cannot be instantiated, and that all of its members are static. A static member has one version regardless of how many instances of its enclosing type are created. • A static class is basically the same as a non-static class, but there is one difference: a static class cannot be externally instantiated. In other words, you cannot use the new keyword to create a variable of the class type. Because there is no instance variable, you access the members of a static class by using the class name itself.
  翻译: