SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
Object-Oriented Programming
Youssef Mohammed Abohaty
Vice Head Technical at Microsoft Tech Club
Agenda : -
• Introduction To OOP .
• Classes .
• Enumeration .
• Structures .
• Encapsulation .
• Inheritance .
• Polymorphism .
Introduction To OOP
Traditional Programming = Spaghetti code
!OOP Programming (OOP Arch Code)
Name Space
Class
Method
Code
Why OOP ?
• More Organized Code .
• Debug Fast .
• Fast to Find Errors .
• More Flexible To use .
Classes : -
• It’s A container to A Collection of Methods .
• It’s Reference Type .
• Constructors “is a Method With The Same Name Of
The Class” .
• Destructors “is a Method With The Same Name Of The
Class With ~ Before the Name”.
Ex :
Class Persone
{
Public Persone()
{
//Code
}
~ Persone()
{
//Code
}
}
Static And Non Static Class
• Non Static Class To Us It Must Make Instance .
Ex :
Person p = new Person();
p.Speak();
• Static Class You Can Us It Direct .
Ex :
Console.WriteLine(“Hello MVA”);
• How To Make A static Class .
Ex :
Static Class Person
{
Private Void Speak()
{
}
}
OverLoading : -
• Over Loading Is A Group Of Methods Have The
Same Name !
Ex :
Public Void Speak (int Num);
Public Void Speak (int Num ,String Txt);
Ex :
MessageBox.Show(String Text);
MessageBox.Show(String Text,String Caption);
MessageBox.Show(String Text , String Caption , Message BoxButtons Button);
Access Modifier : -
• Public : “ Calling From Any Place “ .
• Private : “ Only Calling From The Same Class “ .
• Protected : “ Only Calling From The Inherit Class “ .
• Internal : “ Only Calling From The Current
Assembly File Only “ .
• Protected Intenal : “ Can Calling From The Inherit
Class And From The Current Assembly File “ .
Enumeration : -
• It’s a Group Of Element’s To Represent Cases and
Different Values Inside The Program .
EX :
enum Human
{
Male=0;
Female=1;
}
• Using Name Of enum Only But Real Value stored
as a byte So We Can Use It at (Windows API) .
Structures : -
• Is a special Types To Upload any Properties and
Behaviors as variables Or Methods .
Stuct Human
{
Public String JobTitle;
Public int Age;
Public int Year;
};
Human Mahmoud =new Human();
Mahmoud.JobTitle=“Developer”;
Mahmoud.Age=22;
Mahmoud.Year=2015;
• Struct Can Have an Item Is Another Struct .
• Struct Is a Value Type .
Encapsulation : -
• Is Hide Our Code And Use It As a Black Box From
The Final Method .
• using Access Modifier .
EX :
Human Ahmed =new Ahmed();
Ahmed.Age=6723896349;
• We Can Use Get(Accessor) And Set (Mutator).
EX :
Person
{
Private int Age;
Public Get Age (int age)
{
If(age <=100 $$ age>=1)
{
Age=age; }
else{console.WriteLine(“We Can’t store This Age”);} }
}
Encapsulation (Type Property) : -
Class Person
{
Public int Age
{
get{return Age ; }
set{if (Age<=100 $$ Age>1)
Age=Value;}
}
}
Inheritance : -
• What Is Inheritance Mean ?! .
• Is-a Relation .
• Has-a Relation .
• When I can Use Inheritance ?! .
• Multi Inheritance ! .
EX :
Class Developer : Human
{
// Implementation
}
Inheritance (Saled“Not Inheritable”) : -
Saled Class Human
{
}
This Way Is Wrong !
Class Teacher : Human ×
{}
• You Can Only Use From Object’s .
• Human Teacher =new Human();
Abstract Classes (MustInherit) :-
• Is A class Must Inherit To Use his attributes From
The Inherited Class .
EX :
abstract class Human
{
Public int Age;
}
EX :
class Doctor :Hman
{
}
Interface : -
• Is abstract Class With Out Any Implementation .
Interface Human
{
int Age ;
String JobTitle;
int Year;
}
• More Than Once Inherit .
Polymorphism : -
• You Can Create Class With Out Any
Implementation .
• You Can Change Methods Implementation by
Overriding between two Different Classes.
Public Virtual void Speak()
{
Console,Beep();
}
Public Override void Speak()
{
Console.WriteLine(“Speak”);
}
Abstract Methods : -
• Is a Kind Of Polymorphism but abstract Key Word
Forcing The Developer To Make Override .
Public abstract void Speak()
{
Console,Beep();
}
Public Override void Speak()
{
Console.WriteLine(“Speak”);
}
Thank You !
jozeif_abdelkader70@yahoo.com
jozeif_abdelkader70@outlook.com
en9.youssef@gmail.com
twitter.com/Dev_Youssef

Mais conteúdo relacionado

Mais procurados

Access modifiers
Access modifiersAccess modifiers
Access modifiersJadavsejal
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVASURIT DATTA
 
Constructor in java
Constructor in javaConstructor in java
Constructor in javaHitesh Kumar
 
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...Edureka!
 
Python – Object Oriented Programming
Python – Object Oriented Programming Python – Object Oriented Programming
Python – Object Oriented Programming Raghunath A
 
PHP - Introduction to Object Oriented Programming with PHP
PHP -  Introduction to  Object Oriented Programming with PHPPHP -  Introduction to  Object Oriented Programming with PHP
PHP - Introduction to Object Oriented Programming with PHPVibrant Technologies & Computers
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced JavascriptAdieu
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - ObjectsWebStackAcademy
 
Final keyword in java
Final keyword in javaFinal keyword in java
Final keyword in javaHitesh Kumar
 
Collections - Maps
Collections - Maps Collections - Maps
Collections - Maps Hitesh-Java
 

Mais procurados (20)

Access modifiers
Access modifiersAccess modifiers
Access modifiers
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVA
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
 
Json
JsonJson
Json
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
 
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
 
Object oriented programming in python
Object oriented programming in pythonObject oriented programming in python
Object oriented programming in python
 
Exception handling
Exception handlingException handling
Exception handling
 
Python – Object Oriented Programming
Python – Object Oriented Programming Python – Object Oriented Programming
Python – Object Oriented Programming
 
7.data types in c#
7.data types in c#7.data types in c#
7.data types in c#
 
PHP - Introduction to Object Oriented Programming with PHP
PHP -  Introduction to  Object Oriented Programming with PHPPHP -  Introduction to  Object Oriented Programming with PHP
PHP - Introduction to Object Oriented Programming with PHP
 
Python programming : Inheritance and polymorphism
Python programming : Inheritance and polymorphismPython programming : Inheritance and polymorphism
Python programming : Inheritance and polymorphism
 
Java IO
Java IOJava IO
Java IO
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
 
Exception Handling in Java
Exception Handling in JavaException Handling in Java
Exception Handling in Java
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
 
String, string builder, string buffer
String, string builder, string bufferString, string builder, string buffer
String, string builder, string buffer
 
Final keyword in java
Final keyword in javaFinal keyword in java
Final keyword in java
 
Collections - Maps
Collections - Maps Collections - Maps
Collections - Maps
 

Destaque (12)

Universal Apps for windows 8.1
Universal Apps for windows 8.1Universal Apps for windows 8.1
Universal Apps for windows 8.1
 
The Three "R"
The Three "R"The Three "R"
The Three "R"
 
Chapter03
Chapter03Chapter03
Chapter03
 
Chapter01
Chapter01Chapter01
Chapter01
 
Chapter04
Chapter04Chapter04
Chapter04
 
Chapter05
Chapter05Chapter05
Chapter05
 
Chapter02
Chapter02Chapter02
Chapter02
 
Basics of c# by sabir
Basics of c# by sabirBasics of c# by sabir
Basics of c# by sabir
 
Flowchart
FlowchartFlowchart
Flowchart
 
ใบความรู้ที่ 5 การเขียนผังงานโปรแกรม
ใบความรู้ที่ 5 การเขียนผังงานโปรแกรมใบความรู้ที่ 5 การเขียนผังงานโปรแกรม
ใบความรู้ที่ 5 การเขียนผังงานโปรแกรม
 
การเขียนผังงาน (Flowchart)
การเขียนผังงาน (Flowchart)การเขียนผังงาน (Flowchart)
การเขียนผังงาน (Flowchart)
 
หลักการเขียนผังงาน(Flow chart)
หลักการเขียนผังงาน(Flow chart)หลักการเขียนผังงาน(Flow chart)
หลักการเขียนผังงาน(Flow chart)
 

Semelhante a Object oriented programming With C#

Semelhante a Object oriented programming With C# (20)

Intro to Objective C
Intro to Objective CIntro to Objective C
Intro to Objective C
 
Introduction to java programming
Introduction to java programmingIntroduction to java programming
Introduction to java programming
 
Introduction to c ++ part -1
Introduction to c ++   part -1Introduction to c ++   part -1
Introduction to c ++ part -1
 
Objective-C talk
Objective-C talkObjective-C talk
Objective-C talk
 
RIBBUN SOFTWARE
RIBBUN SOFTWARERIBBUN SOFTWARE
RIBBUN SOFTWARE
 
Java01
Java01Java01
Java01
 
Java01
Java01Java01
Java01
 
Java01
Java01Java01
Java01
 
Java01
Java01Java01
Java01
 
Introduction what is java
Introduction what is javaIntroduction what is java
Introduction what is java
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
 
Sep 15
Sep 15Sep 15
Sep 15
 
Sep 15
Sep 15Sep 15
Sep 15
 
Core java Basics
Core java BasicsCore java Basics
Core java Basics
 
introduction of Object oriented programming
introduction of Object oriented programmingintroduction of Object oriented programming
introduction of Object oriented programming
 
Inheritance
InheritanceInheritance
Inheritance
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Android course session 3 ( OOP ) part 1
Android course session 3 ( OOP ) part 1Android course session 3 ( OOP ) part 1
Android course session 3 ( OOP ) part 1
 
Pi j3.1 inheritance
Pi j3.1 inheritancePi j3.1 inheritance
Pi j3.1 inheritance
 
29c
29c29c
29c
 

Último

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Último (20)

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

Object oriented programming With C#

  • 1. Object-Oriented Programming Youssef Mohammed Abohaty Vice Head Technical at Microsoft Tech Club
  • 2. Agenda : - • Introduction To OOP . • Classes . • Enumeration . • Structures . • Encapsulation . • Inheritance . • Polymorphism .
  • 4. Traditional Programming = Spaghetti code
  • 5. !OOP Programming (OOP Arch Code) Name Space Class Method Code
  • 6. Why OOP ? • More Organized Code . • Debug Fast . • Fast to Find Errors . • More Flexible To use .
  • 7. Classes : - • It’s A container to A Collection of Methods . • It’s Reference Type . • Constructors “is a Method With The Same Name Of The Class” . • Destructors “is a Method With The Same Name Of The Class With ~ Before the Name”. Ex : Class Persone { Public Persone() { //Code } ~ Persone() { //Code } }
  • 8. Static And Non Static Class • Non Static Class To Us It Must Make Instance . Ex : Person p = new Person(); p.Speak(); • Static Class You Can Us It Direct . Ex : Console.WriteLine(“Hello MVA”); • How To Make A static Class . Ex : Static Class Person { Private Void Speak() { } }
  • 9. OverLoading : - • Over Loading Is A Group Of Methods Have The Same Name ! Ex : Public Void Speak (int Num); Public Void Speak (int Num ,String Txt); Ex : MessageBox.Show(String Text); MessageBox.Show(String Text,String Caption); MessageBox.Show(String Text , String Caption , Message BoxButtons Button);
  • 10. Access Modifier : - • Public : “ Calling From Any Place “ . • Private : “ Only Calling From The Same Class “ . • Protected : “ Only Calling From The Inherit Class “ . • Internal : “ Only Calling From The Current Assembly File Only “ . • Protected Intenal : “ Can Calling From The Inherit Class And From The Current Assembly File “ .
  • 11. Enumeration : - • It’s a Group Of Element’s To Represent Cases and Different Values Inside The Program . EX : enum Human { Male=0; Female=1; } • Using Name Of enum Only But Real Value stored as a byte So We Can Use It at (Windows API) .
  • 12. Structures : - • Is a special Types To Upload any Properties and Behaviors as variables Or Methods . Stuct Human { Public String JobTitle; Public int Age; Public int Year; }; Human Mahmoud =new Human(); Mahmoud.JobTitle=“Developer”; Mahmoud.Age=22; Mahmoud.Year=2015; • Struct Can Have an Item Is Another Struct . • Struct Is a Value Type .
  • 13. Encapsulation : - • Is Hide Our Code And Use It As a Black Box From The Final Method . • using Access Modifier . EX : Human Ahmed =new Ahmed(); Ahmed.Age=6723896349; • We Can Use Get(Accessor) And Set (Mutator). EX : Person { Private int Age; Public Get Age (int age) { If(age <=100 $$ age>=1) { Age=age; } else{console.WriteLine(“We Can’t store This Age”);} } }
  • 14. Encapsulation (Type Property) : - Class Person { Public int Age { get{return Age ; } set{if (Age<=100 $$ Age>1) Age=Value;} } }
  • 15. Inheritance : - • What Is Inheritance Mean ?! . • Is-a Relation . • Has-a Relation . • When I can Use Inheritance ?! . • Multi Inheritance ! . EX : Class Developer : Human { // Implementation }
  • 16. Inheritance (Saled“Not Inheritable”) : - Saled Class Human { } This Way Is Wrong ! Class Teacher : Human × {} • You Can Only Use From Object’s . • Human Teacher =new Human();
  • 17. Abstract Classes (MustInherit) :- • Is A class Must Inherit To Use his attributes From The Inherited Class . EX : abstract class Human { Public int Age; } EX : class Doctor :Hman { }
  • 18. Interface : - • Is abstract Class With Out Any Implementation . Interface Human { int Age ; String JobTitle; int Year; } • More Than Once Inherit .
  • 19. Polymorphism : - • You Can Create Class With Out Any Implementation . • You Can Change Methods Implementation by Overriding between two Different Classes. Public Virtual void Speak() { Console,Beep(); } Public Override void Speak() { Console.WriteLine(“Speak”); }
  • 20. Abstract Methods : - • Is a Kind Of Polymorphism but abstract Key Word Forcing The Developer To Make Override . Public abstract void Speak() { Console,Beep(); } Public Override void Speak() { Console.WriteLine(“Speak”); }