SlideShare a Scribd company logo
• Introduction to OOPS
• Class and Object
• Encapsulation
• Inheritance
• Polymorphism
• Interfaces
• Delegate
• Access Modifiers
• Namespace
Agenda
About OOPS
OOPS is a programming language organized around objects (data) rather than action
and logic.
It is composed of self sufficient modules (“Class”), each instance (“Object”)
contains information to manipulate its data (“Members”)
Four main features of OOPS are
• Abstraction
• Encapsulation
• Polymorphism
• Inheritance
Object and Class
• Object is an instance of a class
• Object has state, behavior, and identity
• Object can be created by using the NEW keyword
• Communicates with other objects through message passing
Object
• It is a user defined data type
• In OOP you program a class as a template for a specific object
or groups ob objects that will always have the same features.
• Other types of classes
• Abstract class
• Static class
Class
Encapsulation
Encapsulation is the process of binding/wrapping
the data and methods into a single entity
Encapsulation is realized through the classes.
Encapsulation guarantees the integrity of the data
in the object
Three main parts of Object
• Interface
• Implementation or Behavior
• Member or Instance variables
Access modifiers
are used to
implement
encapsulation
It reduces system
complexity and
thus increases
robustness, by
limiting the
interdependencies
Abstraction is
achieved through
encapsulation
Object and
Properties are
examples for
encapsulation
Inheritance
Inheritance is a way to form new CLASSES using classes that have
already been.
Inheritance is employed to help REUSE existing code with little or no
modification.
The new classes, known as Sub-classes (or derived classes), inherit
attributes and behavior of the pre-existing classes, which are referred to
as Super-classes (or ancestor classes).
The inheritance relationship of SUB and SUPER CLASSES gives rise to a
HIERARCHY.
Inheritance
Purpose
• Reuse, extend, and modify the
behavior defined in other
classes
• Allows to build a hierarchy of
related classes
Only single inheritance is allowed
in .NET
Three types of inheritance
• Implementation
• Interface
• Visual
To avoid inheritance, we need to
use ‘sealed’ keyword
Polymorphism
Many forms of a single object is
called Polymorphism.
Polymorphism is important not
only to the derived classes, but
to the base classes as well.
It allows you to invoke methods
of derived class through base
class reference during runtime.
It has the ability for classes to
provide different
implementations of methods that
are called through the same
name.
Polymorphism Contd…
Polymorphism is of two types:
• Compile time polymorphism/Overloading
• Runtime polymorphism/Overriding
Compile Time Polymorphism
• Compile time polymorphism is method and operators
overloading. It is also called early binding.
• In method overloading method performs the
different task at the different input parameters.
Polymorphism Contd…
• Runtime time polymorphism is done
using inheritance and virtual
functions. Method overriding is
called runtime polymorphism. It is
also called late binding.
• When overriding a method, you
change the behavior of the method
for the derived class. Overloading
a method simply involves having
another method with the same
prototype.
When and why to use method
overloading ?
Runtime Time
Polymorphism
Function Overloading
Using same
name for
two or more
functions
Functions
should differ
with the
function
signature
Function
signature is
1.Number of
parameters
2.Different
data types of
parameters
3.Sequence of
parameters
Return type
is NOT part
of function
signature
Operator overloading
Using
• Static member
functions using the
operator keyword
Syntax
• <access modifier>
<Class Name>
operator <operator
symbol> (parameter
list)
• {
• .Do something
• }
Few types of
operator overloading
• Unary operator
overloading
• Binary operator
overloading
Abstract class
Purpose of an abstract class is to provide a common
definition of a base class
An abstract class cannot be instantiated
Abstract classes may also define abstract methods
Use abstract keyword
Abstract methods have no implementation
Use override keyword to implement abstract methods
Virtual members
Virtual members enable derived classes to extend a base class
Base class member should use virtual and derived class member should use
override
Fields cannot be virtual
Override virtual members in the base class
Inherit base class method without overriding it
Define new non-virtual implementation that hide the base class
implementations
The derived class can choose whether to
Interfaces
Interfaces describe a group of related functionalities
Interfaces are defined by using the INTERFACE keyword
Non-abstract type inheriting the interface must implement all its
members
Interfaces contain no implementation of methods
An interface cannot be instantiated directly
Interfaces Contd…
Classes can inherit from more
than one interface
An interface can itself inherit
from multiple interfaces
Interfaces members are
automatically public
The member of class
implementing interface member
must be of the following
• Public and non-static
• Same name and signature
Difference
Abstract Class Interface
Abstract class may contain concrete
methods
Interface contains methods that must
be abstract
Abstract class may contain non-public
members.
Members in an interface are public by
default
whereas abstract class is used to
"extends".
Interface is used to "implements";
Single inheritance Multiple inheritance
Abstract class can "extends" another
class and "implements" multiple
interfaces.
Interface can "extends" another
interface
One class can only "extends" one
super class
interface is more flexible than
abstract class because it "implements"
multiple interfaces.
Any class can extend an abstract
class.
only an interface can extend another
interface
Delegates
Delegates Contd…
Multi cast delegate
• Refer to multiple methods
of matching signature
• Derived from
System.MulticastDelegate
class
• Example: to call two
methods on a button click
event
Steps to use delegates
• Declare a delegate with a
function signature
• Instantiate the declared
delegate
• Use the delegate to
execute a function
Access Modifiers
All types and type members have
an accessibility level
which controls whether they can
be used from other code in your
assembly or other assemblies.
Access modifiers are
determined by the scope of
visibility for variables and
methods.
Used to implement encapsulation
and abstraction
Access Modifiers
Types of access
modifiers
• private
• public
• protected
• internal
• internal
protected
Default access
modifier for class
is internal
Default access
modifier for data
member is private
Namespace
The namespace keyword is used to declare a scope.
This namespace scope lets you organize code and
gives you a way to create globally unique types.
Within a namespace, you can declare one or more of the following types:
1.another namespace
2.class
3.interface
4.struct
5.enum
6.Delegate
namespace Name1
{
class A {}
}
namespace Name2
{
class A {}
}
We can also use nested namespace
namespace csharp_example
{
// Program start class
class NamespaceCE
{
// Main begins program execution.
public static void Main()
{
// Write to console
Console.WriteLine("This is the new C# Example Namespace.");
}
}
}
Namespace Example
OOPS – General Understanding in .NET

More Related Content

What's hot

Packages and Interfaces
Packages and InterfacesPackages and Interfaces
Packages and Interfaces
AkashDas112
 
Inner Classes & Multi Threading in JAVA
Inner Classes & Multi Threading in JAVAInner Classes & Multi Threading in JAVA
Inner Classes & Multi Threading in JAVATech_MX
 
More oop in java
More oop in javaMore oop in java
More oop in java
SAGARDAVE29
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentals
AnsgarMary
 
Class Members Access/Visibility Guide (Checklist)
Class Members Access/Visibility Guide (Checklist)Class Members Access/Visibility Guide (Checklist)
Class Members Access/Visibility Guide (Checklist)
Jayasree Perilakkalam
 
L7 inheritance
L7 inheritanceL7 inheritance
L7 inheritance
teach4uin
 
Object oriented programming 3 object oriented concepts
Object oriented programming 3 object oriented conceptsObject oriented programming 3 object oriented concepts
Object oriented programming 3 object oriented concepts
Vaibhav Khanna
 
Java packages
Java packagesJava packages
Java packages
Jeffrey Quevedo
 
Inheritance and Polymorphism
Inheritance and PolymorphismInheritance and Polymorphism
Inheritance and Polymorphism
BG Java EE Course
 
Class notes(week 7) on packages
Class notes(week 7) on packagesClass notes(week 7) on packages
Class notes(week 7) on packages
Kuntal Bhowmick
 
Inheritance in Java
Inheritance in JavaInheritance in Java
Inheritance in Java
Ferdin Joe John Joseph PhD
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
Anil Kumar
 
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Simplilearn
 
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
Madishetty Prathibha
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
Greg Sohl
 
Input & output
Input & outputInput & output
Input & output
SAIFUR RAHMAN
 
Methods and constructors
Methods and constructorsMethods and constructors
Methods and constructorsRavi_Kant_Sahu
 
Interface in java By Dheeraj Kumar Singh
Interface in java By Dheeraj Kumar SinghInterface in java By Dheeraj Kumar Singh
Interface in java By Dheeraj Kumar Singh
dheeraj_cse
 

What's hot (20)

Packages and Interfaces
Packages and InterfacesPackages and Interfaces
Packages and Interfaces
 
Inner Classes & Multi Threading in JAVA
Inner Classes & Multi Threading in JAVAInner Classes & Multi Threading in JAVA
Inner Classes & Multi Threading in JAVA
 
More oop in java
More oop in javaMore oop in java
More oop in java
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentals
 
Class Members Access/Visibility Guide (Checklist)
Class Members Access/Visibility Guide (Checklist)Class Members Access/Visibility Guide (Checklist)
Class Members Access/Visibility Guide (Checklist)
 
L7 inheritance
L7 inheritanceL7 inheritance
L7 inheritance
 
Object oriented programming 3 object oriented concepts
Object oriented programming 3 object oriented conceptsObject oriented programming 3 object oriented concepts
Object oriented programming 3 object oriented concepts
 
Java packages
Java packagesJava packages
Java packages
 
Inheritance and Polymorphism
Inheritance and PolymorphismInheritance and Polymorphism
Inheritance and Polymorphism
 
Class notes(week 7) on packages
Class notes(week 7) on packagesClass notes(week 7) on packages
Class notes(week 7) on packages
 
Inheritance in Java
Inheritance in JavaInheritance in Java
Inheritance in Java
 
Inheritance
InheritanceInheritance
Inheritance
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
 
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
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
 
Input & output
Input & outputInput & output
Input & output
 
Methods and constructors
Methods and constructorsMethods and constructors
Methods and constructors
 
Unit 3 Java
Unit 3 JavaUnit 3 Java
Unit 3 Java
 
Interface in java By Dheeraj Kumar Singh
Interface in java By Dheeraj Kumar SinghInterface in java By Dheeraj Kumar Singh
Interface in java By Dheeraj Kumar Singh
 

Similar to OOPS – General Understanding in .NET

Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
colleges
 
Oopsinphp
OopsinphpOopsinphp
Oopsinphp
NithyaNithyav
 
Questpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPSQuestpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPS
gdrealspace
 
full defination of final opp.pptx
full defination of final opp.pptxfull defination of final opp.pptx
full defination of final opp.pptx
rayanbabur
 
Object-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & ProgrammingObject-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & ProgrammingAllan Mangune
 
Object oriented programming
Object oriented programmingObject oriented programming
04_-_Inheritance_Polymorphism_and_Interfaces.pdf
04_-_Inheritance_Polymorphism_and_Interfaces.pdf04_-_Inheritance_Polymorphism_and_Interfaces.pdf
04_-_Inheritance_Polymorphism_and_Interfaces.pdf
markbrianBautista
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
Ahmed Farag
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
Abdii Rashid
 
Better Understanding OOP using C#
Better Understanding OOP using C#Better Understanding OOP using C#
Better Understanding OOP using C#
Chandan Gupta Bhagat
 
Object Oriented Programming - Polymorphism and Interfaces
Object Oriented Programming - Polymorphism and InterfacesObject Oriented Programming - Polymorphism and Interfaces
Object Oriented Programming - Polymorphism and Interfaces
Habtamu Wolde
 
Java 6.pptx
Java 6.pptxJava 6.pptx
Java 6.pptx
usmanusman720379
 
OCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference CardOCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference Card
Hari kiran G
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Nadeesha Thilakarathne
 
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
 
VB.net&OOP.pptx
VB.net&OOP.pptxVB.net&OOP.pptx
VB.net&OOP.pptx
BharathiLakshmiAAssi
 
The smartpath information systems java
The smartpath information systems javaThe smartpath information systems java
The smartpath information systems java
The Smartpath Information Systems,Bhilai,Durg,Chhattisgarh.
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Vasilios Kuznos
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview Qestions
Arun Vasanth
 
Pi j3.2 polymorphism
Pi j3.2 polymorphismPi j3.2 polymorphism
Pi j3.2 polymorphism
mcollison
 

Similar to OOPS – General Understanding in .NET (20)

Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
 
Oopsinphp
OopsinphpOopsinphp
Oopsinphp
 
Questpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPSQuestpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPS
 
full defination of final opp.pptx
full defination of final opp.pptxfull defination of final opp.pptx
full defination of final opp.pptx
 
Object-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & ProgrammingObject-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & Programming
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
04_-_Inheritance_Polymorphism_and_Interfaces.pdf
04_-_Inheritance_Polymorphism_and_Interfaces.pdf04_-_Inheritance_Polymorphism_and_Interfaces.pdf
04_-_Inheritance_Polymorphism_and_Interfaces.pdf
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
 
Better Understanding OOP using C#
Better Understanding OOP using C#Better Understanding OOP using C#
Better Understanding OOP using C#
 
Object Oriented Programming - Polymorphism and Interfaces
Object Oriented Programming - Polymorphism and InterfacesObject Oriented Programming - Polymorphism and Interfaces
Object Oriented Programming - Polymorphism and Interfaces
 
Java 6.pptx
Java 6.pptxJava 6.pptx
Java 6.pptx
 
OCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference CardOCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference Card
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
OOP Introduction with java programming language
OOP Introduction with java programming languageOOP Introduction with java programming language
OOP Introduction with java programming language
 
VB.net&OOP.pptx
VB.net&OOP.pptxVB.net&OOP.pptx
VB.net&OOP.pptx
 
The smartpath information systems java
The smartpath information systems javaThe smartpath information systems java
The smartpath information systems java
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview Qestions
 
Pi j3.2 polymorphism
Pi j3.2 polymorphismPi j3.2 polymorphism
Pi j3.2 polymorphism
 

More from Sabith Byari

Sabith_Byari-Resume_Updated
Sabith_Byari-Resume_UpdatedSabith_Byari-Resume_Updated
Sabith_Byari-Resume_UpdatedSabith Byari
 
Aptitude Age Problems
Aptitude Age ProblemsAptitude Age Problems
Aptitude Age Problems
Sabith Byari
 

More from Sabith Byari (13)

Sabith_Byari-Resume_Updated
Sabith_Byari-Resume_UpdatedSabith_Byari-Resume_Updated
Sabith_Byari-Resume_Updated
 
C your C
C your CC your C
C your C
 
Simplification
SimplificationSimplification
Simplification
 
Seating arr
Seating arrSeating arr
Seating arr
 
Ratio
RatioRatio
Ratio
 
Puzzles
PuzzlesPuzzles
Puzzles
 
Pie
PiePie
Pie
 
Number theory
Number theoryNumber theory
Number theory
 
Aptitude trains
Aptitude trainsAptitude trains
Aptitude trains
 
Aptitude average
Aptitude averageAptitude average
Aptitude average
 
Apti numbers
Apti numbersApti numbers
Apti numbers
 
Time and work
Time and workTime and work
Time and work
 
Aptitude Age Problems
Aptitude Age ProblemsAptitude Age Problems
Aptitude Age Problems
 

Recently uploaded

First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 

Recently uploaded (20)

First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 

OOPS – General Understanding in .NET

  • 1.
  • 2. • Introduction to OOPS • Class and Object • Encapsulation • Inheritance • Polymorphism • Interfaces • Delegate • Access Modifiers • Namespace Agenda
  • 3. About OOPS OOPS is a programming language organized around objects (data) rather than action and logic. It is composed of self sufficient modules (“Class”), each instance (“Object”) contains information to manipulate its data (“Members”) Four main features of OOPS are • Abstraction • Encapsulation • Polymorphism • Inheritance
  • 4. Object and Class • Object is an instance of a class • Object has state, behavior, and identity • Object can be created by using the NEW keyword • Communicates with other objects through message passing Object • It is a user defined data type • In OOP you program a class as a template for a specific object or groups ob objects that will always have the same features. • Other types of classes • Abstract class • Static class Class
  • 5. Encapsulation Encapsulation is the process of binding/wrapping the data and methods into a single entity Encapsulation is realized through the classes. Encapsulation guarantees the integrity of the data in the object Three main parts of Object • Interface • Implementation or Behavior • Member or Instance variables
  • 6. Access modifiers are used to implement encapsulation It reduces system complexity and thus increases robustness, by limiting the interdependencies Abstraction is achieved through encapsulation Object and Properties are examples for encapsulation
  • 7. Inheritance Inheritance is a way to form new CLASSES using classes that have already been. Inheritance is employed to help REUSE existing code with little or no modification. The new classes, known as Sub-classes (or derived classes), inherit attributes and behavior of the pre-existing classes, which are referred to as Super-classes (or ancestor classes). The inheritance relationship of SUB and SUPER CLASSES gives rise to a HIERARCHY.
  • 8. Inheritance Purpose • Reuse, extend, and modify the behavior defined in other classes • Allows to build a hierarchy of related classes Only single inheritance is allowed in .NET Three types of inheritance • Implementation • Interface • Visual To avoid inheritance, we need to use ‘sealed’ keyword
  • 9. Polymorphism Many forms of a single object is called Polymorphism. Polymorphism is important not only to the derived classes, but to the base classes as well. It allows you to invoke methods of derived class through base class reference during runtime. It has the ability for classes to provide different implementations of methods that are called through the same name.
  • 10. Polymorphism Contd… Polymorphism is of two types: • Compile time polymorphism/Overloading • Runtime polymorphism/Overriding Compile Time Polymorphism • Compile time polymorphism is method and operators overloading. It is also called early binding. • In method overloading method performs the different task at the different input parameters.
  • 11. Polymorphism Contd… • Runtime time polymorphism is done using inheritance and virtual functions. Method overriding is called runtime polymorphism. It is also called late binding. • When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same prototype. When and why to use method overloading ? Runtime Time Polymorphism
  • 12. Function Overloading Using same name for two or more functions Functions should differ with the function signature Function signature is 1.Number of parameters 2.Different data types of parameters 3.Sequence of parameters Return type is NOT part of function signature
  • 13. Operator overloading Using • Static member functions using the operator keyword Syntax • <access modifier> <Class Name> operator <operator symbol> (parameter list) • { • .Do something • } Few types of operator overloading • Unary operator overloading • Binary operator overloading
  • 14. Abstract class Purpose of an abstract class is to provide a common definition of a base class An abstract class cannot be instantiated Abstract classes may also define abstract methods Use abstract keyword Abstract methods have no implementation Use override keyword to implement abstract methods
  • 15. Virtual members Virtual members enable derived classes to extend a base class Base class member should use virtual and derived class member should use override Fields cannot be virtual
  • 16. Override virtual members in the base class Inherit base class method without overriding it Define new non-virtual implementation that hide the base class implementations The derived class can choose whether to
  • 17. Interfaces Interfaces describe a group of related functionalities Interfaces are defined by using the INTERFACE keyword Non-abstract type inheriting the interface must implement all its members Interfaces contain no implementation of methods An interface cannot be instantiated directly
  • 18. Interfaces Contd… Classes can inherit from more than one interface An interface can itself inherit from multiple interfaces Interfaces members are automatically public The member of class implementing interface member must be of the following • Public and non-static • Same name and signature
  • 19. Difference Abstract Class Interface Abstract class may contain concrete methods Interface contains methods that must be abstract Abstract class may contain non-public members. Members in an interface are public by default whereas abstract class is used to "extends". Interface is used to "implements"; Single inheritance Multiple inheritance Abstract class can "extends" another class and "implements" multiple interfaces. Interface can "extends" another interface One class can only "extends" one super class interface is more flexible than abstract class because it "implements" multiple interfaces. Any class can extend an abstract class. only an interface can extend another interface
  • 21. Delegates Contd… Multi cast delegate • Refer to multiple methods of matching signature • Derived from System.MulticastDelegate class • Example: to call two methods on a button click event Steps to use delegates • Declare a delegate with a function signature • Instantiate the declared delegate • Use the delegate to execute a function
  • 22. Access Modifiers All types and type members have an accessibility level which controls whether they can be used from other code in your assembly or other assemblies. Access modifiers are determined by the scope of visibility for variables and methods. Used to implement encapsulation and abstraction
  • 23. Access Modifiers Types of access modifiers • private • public • protected • internal • internal protected Default access modifier for class is internal Default access modifier for data member is private
  • 24. Namespace The namespace keyword is used to declare a scope. This namespace scope lets you organize code and gives you a way to create globally unique types. Within a namespace, you can declare one or more of the following types: 1.another namespace 2.class 3.interface 4.struct 5.enum 6.Delegate
  • 25. namespace Name1 { class A {} } namespace Name2 { class A {} } We can also use nested namespace namespace csharp_example { // Program start class class NamespaceCE { // Main begins program execution. public static void Main() { // Write to console Console.WriteLine("This is the new C# Example Namespace."); } } } Namespace Example