0% found this document useful (0 votes)
52 views

Object Oriented Programming

Uploaded by

alisakhi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Object Oriented Programming

Uploaded by

alisakhi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Programming C# 2.0, 3.0, 4.

Muhammed Ali Sakhi


Microsoft Certified Trainer

© PakDev.net
Agenda
Understand Classes and Objects
Access Modifiers and Static keyword
Constructors and Overloads

© PakDev.net
Classes and Objects
Classify based on common behaviour or
attributes
A data structure that includes both data and
functions
An object is an instance of a class
A class is a blueprint for an object
Encapsulation: Combining data and methods

© PakDev.net
Access Modifiers and Static
Methods are public, accessible from the outside
Data is private, accessible only from the inside
Static data describes information for all objects
of a class
Static methods can only access static data

© PakDev.net
Constructors
Called automatically when the object is created
Compiler creates a default constructor
If there is an explicit constructor, then compiler
does not create one
Constructor name should be same as the class
name
Constructor return type is always void
Constructors can be overloaded

© PakDev.net
Classes and Constructors

Demo

© PakDev.net
Demonstration Steps
Create an BankAccount Class

Create public and private fields

Create static field

Create Overloaded constructors

© PakDev.net
Thank you
PakDev.net

© PakDev.net

You might also like