SlideShare a Scribd company logo
1 of 29
Unusual C#OOP Gate Prepared & Presented by: Eng. : Medhat Dawoud
Relax your self
Let your imaginations
I want you to know that we are learning :
Actually it’s  Usual C# 
General Overview What is OOP ? What is class? Difference between class and object. The life cycle of an object: Construction  Destruction The accessibility. Static Vs Instance. Reference type Vs. Value type. OOP techniques.
What is OOP ? ,[object Object],Object Oriented Programming and Procedure Oriented Programming. ,[object Object]
A real example : car manufacturing. ,[object Object]
What is OOP ? ,[object Object],Object Oriented Programming and Procedure Oriented Programming. ,[object Object]
A real example : car manufacturing. ,[object Object]
Difference between class and object: What is an object ? object is a building block of an OOP application, this building block encapsulates part of the application. Objects are created from types, these types of an object is known by classes. The object is an instance of a class. We treat with classes through objects. “every thing is object”
The life cycle of an object: The object has three cases: Construction. Default constructor is often public. What if it become private?  Being in use. Destruction.
The accessibility Determine which code can access these members that is whether they are available to all code ( public ) or only to code within the class ( private ). The modifier ( protected ). We can make fields privates and provide access to them via public properties.(the encapsulation)
Static Vs Instance Static members are shared between instances of the class. When using static members you needn’t to instantiate an object. To use Instance members you must instantiate an object from the class.
Reference type Vs Value type
OOP techniques Encapsulation. Abstract. Interface. Inheritance. Polymorphism.
Encapsulation Making fields privates and provide access to them via public properties. Classes Idea is encapsulation. Why encapsulation ?
Abstract Abstract class is a class that may or may not contain abstract methods. Abstract class can’t be instantiated. An abstract method is a method that is declared without an implementation. If a class includes abstract methods, the class itself must be declared abstract.
 Interface  If an abstract class contains only abstract method declarations, it should be declared as an interface instead. Interface can’t be instantiated. You can implement interface in an inherited class. Imagine the interface as a contract between interface creator and class consumers.
Inheritance Child class inherited from (derived from) parent class (base class). In C#, you may derive only from a single base class directly. You can override a member in child class that is virtual in the parent class. A class may be sealed. C# provide a common base class for all objects called object.
Polymorphism It is very useful for performing tasks with a minimum of code on different objects from a single class. Overriding & Overloading. Polymorphism means that :  you can use the same instruction with different return value into screen.
Practice
Any Questions ? I have some questions !!
Can you allow class to be inherited, but prevent the method from being over-ridden? Yes, just leave the class public and make the method sealed.
Can you override private virtual methods? No, you cannot access private methods in inherited classes.
Can you declare the override method static while the original method is non-static? No, you can't, the signature of the virtual method must remain the same, only the keyword virtual is changed to keyword override
The last question.. Is it true or false , and why ? False , Because its constructor is private 
Contact me for any inquiry MedhatDawoud[at]Gmail.com ..E-mail me.. twitter.com/Med7atDawoud ..follow me.. Med7at.wordpress.com ..Current Blog.. www.MedhatDawoud.com ..Coming soon.. 
Thanks for listening

More Related Content

What's hot

What's hot (20)

Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented Principles
 
What are Abstract Classes in Java | Edureka
What are Abstract Classes in Java | EdurekaWhat are Abstract Classes in Java | Edureka
What are Abstract Classes in Java | Edureka
 
Abstract class and interface
Abstract class and interfaceAbstract class and interface
Abstract class and interface
 
WHAT IS ABSTRACTION IN JAVA
WHAT IS ABSTRACTION IN JAVAWHAT IS ABSTRACTION IN JAVA
WHAT IS ABSTRACTION IN JAVA
 
Java interfaces & abstract classes
Java interfaces & abstract classesJava interfaces & abstract classes
Java interfaces & abstract classes
 
Abstract class and Interface
Abstract class and InterfaceAbstract class and Interface
Abstract class and Interface
 
Polymorphism in java
Polymorphism in javaPolymorphism in java
Polymorphism in java
 
Oops presentation java
Oops presentation javaOops presentation java
Oops presentation 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
 
Abstract Class Presentation
Abstract Class PresentationAbstract Class Presentation
Abstract Class Presentation
 
Framework Design Guidelines
Framework Design GuidelinesFramework Design Guidelines
Framework Design Guidelines
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 
Chapter 9 Interface
Chapter 9 InterfaceChapter 9 Interface
Chapter 9 Interface
 
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
C# Interface | Interfaces In C# | C# Interfaces Explained | C# Tutorial For B...
 
Interface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementationInterface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementation
 
Java OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & InterfaceJava OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & Interface
 
C#
C#C#
C#
 
Object Oriented Programming - Basic Concepts
Object Oriented Programming - Basic ConceptsObject Oriented Programming - Basic Concepts
Object Oriented Programming - Basic Concepts
 
Vvi
VviVvi
Vvi
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 

Viewers also liked

Viewers also liked (8)

Diving in OOP (Day 1) : Polymorphism and Inheritance (Early Binding/Compile T...
Diving in OOP (Day 1) : Polymorphism and Inheritance (Early Binding/Compile T...Diving in OOP (Day 1) : Polymorphism and Inheritance (Early Binding/Compile T...
Diving in OOP (Day 1) : Polymorphism and Inheritance (Early Binding/Compile T...
 
OOP Basics
OOP BasicsOOP Basics
OOP Basics
 
java concept
java conceptjava concept
java concept
 
What does OOP stand for?
What does OOP stand for?What does OOP stand for?
What does OOP stand for?
 
C# OOP Advanced Concepts
C# OOP Advanced ConceptsC# OOP Advanced Concepts
C# OOP Advanced Concepts
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
C#/.NET Little Wonders
C#/.NET Little WondersC#/.NET Little Wonders
C#/.NET Little Wonders
 
Jump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternJump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design Pattern
 

Similar to Unusual C# - OOP

Object-oriented programming 3.pptx
Object-oriented programming 3.pptxObject-oriented programming 3.pptx
Object-oriented programming 3.pptx
Adikhan27
 

Similar to Unusual C# - OOP (20)

OOP interview questions & answers.
OOP interview questions & answers.OOP interview questions & answers.
OOP interview questions & answers.
 
Android interview questions
Android interview questionsAndroid interview questions
Android interview questions
 
Android interview questions
Android interview questionsAndroid interview questions
Android interview questions
 
Basic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a jobBasic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a job
 
Core java questions
Core java questionsCore java questions
Core java questions
 
OOPS ABAP.docx
OOPS ABAP.docxOOPS ABAP.docx
OOPS ABAP.docx
 
C# interview quesions
C# interview quesionsC# interview quesions
C# interview quesions
 
C# interview-questions
C# interview-questionsC# interview-questions
C# interview-questions
 
Understanding class, object & interface
Understanding class, object & interfaceUnderstanding class, object & interface
Understanding class, object & interface
 
Automation Testing - Part 2 (Things to know in JAVA) - SLT
Automation Testing - Part 2 (Things to know in JAVA) - SLTAutomation Testing - Part 2 (Things to know in JAVA) - SLT
Automation Testing - Part 2 (Things to know in JAVA) - SLT
 
Automation Testing - Part 2 (Things to know in JAVA) - SLT
Automation Testing - Part 2 (Things to know in JAVA) - SLTAutomation Testing - Part 2 (Things to know in JAVA) - SLT
Automation Testing - Part 2 (Things to know in JAVA) - SLT
 
Top 10 Interview Questions For Java
Top 10 Interview Questions For JavaTop 10 Interview Questions For Java
Top 10 Interview Questions For Java
 
Advanced Programming _Abstract Classes vs Interfaces (Java)
Advanced Programming _Abstract Classes vs Interfaces (Java)Advanced Programming _Abstract Classes vs Interfaces (Java)
Advanced Programming _Abstract Classes vs Interfaces (Java)
 
C#.net interview questions for dynamics 365 ce crm developers
C#.net interview questions for dynamics 365 ce crm developersC#.net interview questions for dynamics 365 ce crm developers
C#.net interview questions for dynamics 365 ce crm developers
 
20 most important java programming interview questions
20 most important java programming interview questions20 most important java programming interview questions
20 most important java programming interview questions
 
C# question answers
C# question answersC# question answers
C# question answers
 
Java OOPs Concepts.docx
Java OOPs Concepts.docxJava OOPs Concepts.docx
Java OOPs Concepts.docx
 
Object-oriented programming 3.pptx
Object-oriented programming 3.pptxObject-oriented programming 3.pptx
Object-oriented programming 3.pptx
 
Java Core
Java CoreJava Core
Java Core
 
1
11
1
 

More from Medhat Dawoud (13)

Real time web
Real time webReal time web
Real time web
 
Using Git and BitBucket
Using Git and BitBucketUsing Git and BitBucket
Using Git and BitBucket
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Select your career
Select your careerSelect your career
Select your career
 
Intro to t sql – 3rd session
Intro to t sql – 3rd sessionIntro to t sql – 3rd session
Intro to t sql – 3rd session
 
Intro to T-SQL - 1st session
Intro to T-SQL - 1st sessionIntro to T-SQL - 1st session
Intro to T-SQL - 1st session
 
Intro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionIntro to T-SQL – 2nd session
Intro to T-SQL – 2nd session
 
Mesh cloud (road to mongoDB)
Mesh cloud (road to mongoDB)Mesh cloud (road to mongoDB)
Mesh cloud (road to mongoDB)
 
Before start
Before startBefore start
Before start
 
DevMix Startup
DevMix StartupDevMix Startup
DevMix Startup
 
Threading in C#
Threading in C#Threading in C#
Threading in C#
 
How to python
How to pythonHow to python
How to python
 
Program threats
Program threatsProgram threats
Program threats
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 

Unusual C# - OOP

  • 1. Unusual C#OOP Gate Prepared & Presented by: Eng. : Medhat Dawoud
  • 4. I want you to know that we are learning :
  • 5. Actually it’s Usual C# 
  • 6. General Overview What is OOP ? What is class? Difference between class and object. The life cycle of an object: Construction Destruction The accessibility. Static Vs Instance. Reference type Vs. Value type. OOP techniques.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. Difference between class and object: What is an object ? object is a building block of an OOP application, this building block encapsulates part of the application. Objects are created from types, these types of an object is known by classes. The object is an instance of a class. We treat with classes through objects. “every thing is object”
  • 12. The life cycle of an object: The object has three cases: Construction. Default constructor is often public. What if it become private? Being in use. Destruction.
  • 13. The accessibility Determine which code can access these members that is whether they are available to all code ( public ) or only to code within the class ( private ). The modifier ( protected ). We can make fields privates and provide access to them via public properties.(the encapsulation)
  • 14. Static Vs Instance Static members are shared between instances of the class. When using static members you needn’t to instantiate an object. To use Instance members you must instantiate an object from the class.
  • 15. Reference type Vs Value type
  • 16. OOP techniques Encapsulation. Abstract. Interface. Inheritance. Polymorphism.
  • 17. Encapsulation Making fields privates and provide access to them via public properties. Classes Idea is encapsulation. Why encapsulation ?
  • 18. Abstract Abstract class is a class that may or may not contain abstract methods. Abstract class can’t be instantiated. An abstract method is a method that is declared without an implementation. If a class includes abstract methods, the class itself must be declared abstract.
  • 19. Interface  If an abstract class contains only abstract method declarations, it should be declared as an interface instead. Interface can’t be instantiated. You can implement interface in an inherited class. Imagine the interface as a contract between interface creator and class consumers.
  • 20. Inheritance Child class inherited from (derived from) parent class (base class). In C#, you may derive only from a single base class directly. You can override a member in child class that is virtual in the parent class. A class may be sealed. C# provide a common base class for all objects called object.
  • 21. Polymorphism It is very useful for performing tasks with a minimum of code on different objects from a single class. Overriding & Overloading. Polymorphism means that : you can use the same instruction with different return value into screen.
  • 23. Any Questions ? I have some questions !!
  • 24. Can you allow class to be inherited, but prevent the method from being over-ridden? Yes, just leave the class public and make the method sealed.
  • 25. Can you override private virtual methods? No, you cannot access private methods in inherited classes.
  • 26. Can you declare the override method static while the original method is non-static? No, you can't, the signature of the virtual method must remain the same, only the keyword virtual is changed to keyword override
  • 27. The last question.. Is it true or false , and why ? False , Because its constructor is private 
  • 28. Contact me for any inquiry MedhatDawoud[at]Gmail.com ..E-mail me.. twitter.com/Med7atDawoud ..follow me.. Med7at.wordpress.com ..Current Blog.. www.MedhatDawoud.com ..Coming soon.. 