SlideShare a Scribd company logo
1 of 33
Software Development  Training Program Zeeshan Hanif Zeeshan Hanif
DotNet 3.5-101 Lecture 6 Zeeshan Hanif Zeeshan Hanif [email_address] [email_address]
Object Oriented Programming ,[object Object],[object Object],[object Object],Zeeshan Hanif
Object in Everyday Life ,[object Object],Zeeshan Hanif
Object in Programming ,[object Object],[object Object],[object Object],Zeeshan Hanif
Class and Object ,[object Object],[object Object],[object Object],Zeeshan Hanif
Class and Object ,[object Object],[object Object],Zeeshan Hanif
Class and Object ,[object Object],[object Object],[object Object],Zeeshan Hanif
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],Zeeshan Hanif
Class Members ,[object Object],[object Object],[object Object],[object Object],[object Object],Zeeshan Hanif
Zeeshan Hanif Class Definition public class Car{ public static int wheel; public string color; public bool isAutomatic; } Car1 Color isAutomatic Car2 Color isAutomatic Each object gets its own copy Shared between all objects Car.Wheel Car objects wheel
Class Members ,[object Object],[object Object],[object Object],[object Object],Zeeshan Hanif
Class Members Zeeshan Hanif c1 instance Instance Fields color c2 instance Instance Fields color All Methods NoOfWheels() Start() Car Class Static Fields wheel
Defining Methods Zeeshan Hanif public int start(int a, string b,......) { // Executable code } The type of the value to be returned Name of the method The specification of the parameters for the method. If the method has no parameters, leave the parentheses empty Access modifier This is called the body of method Method Signature
Defining Methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Zeeshan Hanif
Encapsulation ,[object Object],Zeeshan Hanif
Properties ,[object Object],[object Object],[object Object],Zeeshan Hanif
Properties syntax Zeeshan Hanif public class Student { private string name; public string  GetName () { return name; } public void  SetName (string a) { name = a; } } public class Student  { private string name; public string Name  { get { return name; } set { name = value; } }} Using Property   Using Methods
Method Overloading ,[object Object],[object Object],Zeeshan Hanif
Method Overloading ,[object Object],Zeeshan Hanif
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Zeeshan Hanif
this ,[object Object],[object Object],Zeeshan Hanif
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Zeeshan Hanif
Constructor ,[object Object],[object Object],Zeeshan Hanif
Constructor ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Zeeshan Hanif
Constructor ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Zeeshan Hanif
Multiple Constructor ,[object Object],[object Object],[object Object],[object Object],[object Object],Zeeshan Hanif
Constant and Readonly Fields ,[object Object],[object Object],[object Object],Zeeshan Hanif
const ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Zeeshan Hanif
readonly ,[object Object],[object Object],Zeeshan Hanif
readonly ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Zeeshan Hanif
Variable length parameter Lists ,[object Object],[object Object],[object Object],Zeeshan Hanif
params ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Zeeshan Hanif

More Related Content

What's hot

08 class and object
08   class and object08   class and object
08 class and object
dhrubo kayal
 
class and objects
class and objectsclass and objects
class and objects
Payel Guria
 

What's hot (18)

C++ classes
C++ classesC++ classes
C++ classes
 
[OOP - Lec 18] Static Data Member
[OOP - Lec 18] Static Data Member[OOP - Lec 18] Static Data Member
[OOP - Lec 18] Static Data Member
 
08 class and object
08   class and object08   class and object
08 class and object
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functions
 
3. Data types and Variables
3. Data types and Variables3. Data types and Variables
3. Data types and Variables
 
Classes&objects
Classes&objectsClasses&objects
Classes&objects
 
10. Introduction to Datastructure
10. Introduction to Datastructure10. Introduction to Datastructure
10. Introduction to Datastructure
 
Chapter2 array of objects
Chapter2 array of objectsChapter2 array of objects
Chapter2 array of objects
 
An introduction to functional programming with Swift
An introduction to functional programming with SwiftAn introduction to functional programming with Swift
An introduction to functional programming with Swift
 
class and objects
class and objectsclass and objects
class and objects
 
Reviewing OOP Design patterns
Reviewing OOP Design patternsReviewing OOP Design patterns
Reviewing OOP Design patterns
 
‫Chapter3 inheritance
‫Chapter3 inheritance‫Chapter3 inheritance
‫Chapter3 inheritance
 
[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP
 
Final keyword in java
Final keyword in javaFinal keyword in java
Final keyword in java
 
CPP15 - Inheritance
CPP15 - InheritanceCPP15 - Inheritance
CPP15 - Inheritance
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template Library
 
12. Stack
12. Stack12. Stack
12. Stack
 
Chapter 2 java
Chapter 2 javaChapter 2 java
Chapter 2 java
 

Viewers also liked (8)

C Sharp Jn (3)
C Sharp Jn (3)C Sharp Jn (3)
C Sharp Jn (3)
 
C Sharp Jn (6)
C Sharp Jn (6)C Sharp Jn (6)
C Sharp Jn (6)
 
C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
 
C Sharp Jn
C Sharp JnC Sharp Jn
C Sharp Jn
 
C Sharp Jn (5)
C Sharp Jn (5)C Sharp Jn (5)
C Sharp Jn (5)
 
C Sharp Jn (1)
C Sharp Jn (1)C Sharp Jn (1)
C Sharp Jn (1)
 
DOCILITY (IMPRONTA) FULL
DOCILITY (IMPRONTA) FULLDOCILITY (IMPRONTA) FULL
DOCILITY (IMPRONTA) FULL
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post Formats
 

Similar to C Sharp Jn (5)

Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4
dplunkett
 
JavaScript - Programming Languages course
JavaScript - Programming Languages course JavaScript - Programming Languages course
JavaScript - Programming Languages course
yoavrubin
 
9781439035665 ppt ch07
9781439035665 ppt ch079781439035665 ppt ch07
9781439035665 ppt ch07
Terry Yoast
 

Similar to C Sharp Jn (5) (20)

Classes_python.pptx
Classes_python.pptxClasses_python.pptx
Classes_python.pptx
 
Java is an Object-Oriented Language
Java is an Object-Oriented LanguageJava is an Object-Oriented Language
Java is an Object-Oriented Language
 
java
javajava
java
 
Classes2
Classes2Classes2
Classes2
 
Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4
 
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
 
java tr.docx
java tr.docxjava tr.docx
java tr.docx
 
Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshow
 
Drupaljam xl 2019 presentation multilingualism makes better programmers
Drupaljam xl 2019 presentation   multilingualism makes better programmersDrupaljam xl 2019 presentation   multilingualism makes better programmers
Drupaljam xl 2019 presentation multilingualism makes better programmers
 
Java 8 presentation
Java 8 presentationJava 8 presentation
Java 8 presentation
 
Java basics
Java basicsJava basics
Java basics
 
Chap2 class,objects
Chap2 class,objectsChap2 class,objects
Chap2 class,objects
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
 
JavaScript - Programming Languages course
JavaScript - Programming Languages course JavaScript - Programming Languages course
JavaScript - Programming Languages course
 
9781439035665 ppt ch07
9781439035665 ppt ch079781439035665 ppt ch07
9781439035665 ppt ch07
 
Hemajava
HemajavaHemajava
Hemajava
 
Basic concept of class, method , command line-argument
Basic concept of class, method , command line-argumentBasic concept of class, method , command line-argument
Basic concept of class, method , command line-argument
 
The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185
 
Java 8
Java 8Java 8
Java 8
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

C Sharp Jn (5)

  • 1. Software Development Training Program Zeeshan Hanif Zeeshan Hanif
  • 2. DotNet 3.5-101 Lecture 6 Zeeshan Hanif Zeeshan Hanif [email_address] [email_address]
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. Zeeshan Hanif Class Definition public class Car{ public static int wheel; public string color; public bool isAutomatic; } Car1 Color isAutomatic Car2 Color isAutomatic Each object gets its own copy Shared between all objects Car.Wheel Car objects wheel
  • 12.
  • 13. Class Members Zeeshan Hanif c1 instance Instance Fields color c2 instance Instance Fields color All Methods NoOfWheels() Start() Car Class Static Fields wheel
  • 14. Defining Methods Zeeshan Hanif public int start(int a, string b,......) { // Executable code } The type of the value to be returned Name of the method The specification of the parameters for the method. If the method has no parameters, leave the parentheses empty Access modifier This is called the body of method Method Signature
  • 15.
  • 16.
  • 17.
  • 18. Properties syntax Zeeshan Hanif public class Student { private string name; public string GetName () { return name; } public void SetName (string a) { name = a; } } public class Student { private string name; public string Name { get { return name; } set { name = value; } }} Using Property Using Methods
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.