SlideShare a Scribd company logo
Focused more for interview Perspective and Easy Understanding
 Object-Oriented Programming (OOP) is a
software development paradigm that
suggests developers to split a program in
building blocks known as objects.
 The OOP paradigm allows developers to
define the object's data, functions, and its
relationship with other objects.
 Code Reusability
 Enables to model real world object
 Easy Modification
 Easy Maintenance
 More Flexible
 Defines an Abstract thing of a thing (i.e.
Object)
 Explaining its Behavior
 A user-defined data structure that groups
properties and methods.
 Class doesn’t occupies memory.
 Class is a definition
 Abstract classes are classes that can have no
instances
 A Single entity Which holds Data and Method.
 It’s Structure.
 Should be understandable by a non-
Programmer
DOG
(Class)
Color, Shape
(Characteristic)
Bark, Pee, Run
(Behaviors)
Members
Abstract characteristics
of a thing
Fields - _Color
Properties - Color
Fields - _Color
Properties - Color
 Specify Class Name
 Declare Data members
 Declare Methods
 Define the Processing
Program them in the following order:
 Namespace: The namespace is a keyword that
defines a distinctive name or last name for the
class. A namespace categorizes and organizes the
library (assembly) where the class belongs and
avoids collisions with classes that share the same
name.
 Class declaration: Line of code where the class
name and type are defined.
 Fields: Set of variables declared in a class block.
 Constants: Set of constants declared in a class
block.
 Constructors: A method or group of methods
that contains code to initialize the class.
 Properties: The set of descriptive data of an
object.
 Events: Program responses that get fired
after a user or application action.
 Methods: Set of functions of the class.
 Destructor: A method that is called when the
class is destroyed.
 In managed code, the Garbage Collector is in
charge of destroying objects; however, in some
cases developers need to take extra actions when
objects are being released, such as freeing
handles or de-allocating unmanaged objects.
 In .NET, there is no concept of deterministic
destructors. The Garbage Collector will call the
Finalize() method at a non-deterministic time
while reclaiming memory for the application.
Access keywords
 Access keywords define the access to class
members from the same class and from other
classes. The most common access keywords are:
 Public: Allows access to the class member from
any other class.
 Private: Allows access to the class member only
in the same class.
 Protected: Allows access to the class member
only within the same class and from inherited
classes.
 Internal: Allows access to the class member
only in the same assembly.
 Protected internal: Allows access to the class
member only within the same class, from
inherited classes, and other classes in the
same assembly. Static: Indicates that the
member can be called without first
instantiating the class.
 A particular Instance of a Class
 Objects are the building blocks of OOP
 Represent real world things in an abstract way
 Commonly defined as variables or data
structures that encapsulate behavior and data
in a programmed unit
 The objects will all act as independent units in
their own right, and they will be responsible
for carrying out a certain process
 Object identity:
 Every object is unique and can be differentiated from
other objects. Each time and object is created
(instantiated) the object identity is defined.
 Object behavior:
 What the object can do. In OOP, methods work as
functions that define the set of actions that the object
can do.
 Object state:
 The data stored within the object at any given
moment. In OOP, fields, constants, and properties
define the state of an object.
 Inheritance
 Abstraction
 Polymorphism
 Encapsulation
 Event
 Is like inheriting the abstract characteristics from
other class - It is a kind of hierarchy
 Base Class will be inherited to derived class
 is a way to form new classes using classes that
have already been defined
 is-a relationships represent a hierarchy between
classes of objects
 Use:
 Reuse of Code – uses the attributes of the base class
 Extensibility – Has it’s own Attributes
.Net Inheritance Concepts
March 15, 2004
Brian Berejik
Matt Jackson
Vinnie Alwani
 Simple / Single
 Multilevel
 Hierarchical
 Multiple
 Hybrid
 Superclass: Parent class
 Subclass: Child class
 Base class: Parent class
 Derived class: Child class
 Is like inheriting from more than one base
class.
 .Net do not allow. But using Multiple interface
inheritance this can be achieved.
 Information Hiding
 Visibility to the methods and not to the fields
 E.g. A Report designer for a programmer
 Packs the data and Method and protects from
external tampering
 Exposing only the details that are relevant: the
public interface
 Improves Security
 Protected cName as string
Protected Function ChangeName(NewName)
Me.cName = NewName
End Function
 As we cannot hide entire object we give access
to some specific part of data.
 Conceptual boundaries of an object
 Focuses on the essential characteristics of an
object
 a named entity made up of selected attributes
and behavior specific to a particular usage of
the originating entity
 Improves Security
For example see notes below
 One entity existing in multiple forms
 Behavior depends on the type of data
 Same message to diff objects results in
different behavior
 Linked to inheritance and assures that derived
class to override the implementation of
parents methods.
 Class Employee
Function PayEmployee()
PayEmployee = Hours * HourlyRate
End Function
 Class CommissionedEmployee
Inherits Employee
Overrides Function PayEmployee()
PayEmployee = BasePay + Commissions
End Function
 Upcasting
Casting an object of any type to another type
which is above it in the inheritance hierarchy.
 Downcasting
Casting an object of any type to another type
which is below it in the inheritance hierarchy.
Example
 Sealed Class
When applied to a class, the sealed modifier prevents
other classes from inheriting from it.
 static classes and static methods are used to create
data and functions that can be accessed without
creating an instance of the class.
class CompanyInfo {
public string GetCompanyName() { return "CompanyName"; }
public string GetComAddress() { return "ComAddress"; }
 These methods do not need to be attached to a
specific instance of the class. Therefore, instead of
creating unnecessary instances of this class, you can
declare it as a static class, like this:
static class CompanyInfo {
public static string GetCompanyName() {return "CompanyName";}
public static string GetComAddress() {return "ComAddress";}
 www.c-sharpcorner.com
 www.csharpcorner.com 2
 www.kuro5hin.org
 www.informit.com
 www.forums.asp.net
 www.developerfusion.com
 www.msdn.microsoft.com

More Related Content

Similar to oops-123991513147-phpapp02.pdf

Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
mustafa sarac
 
python.pptx
python.pptxpython.pptx
python.pptx
Dhanushrajucm
 
Php oop (1)
Php oop (1)Php oop (1)
Php oop (1)
Sudip Simkhada
 
Is2215 lecture2 student(2)
Is2215 lecture2 student(2)Is2215 lecture2 student(2)
Is2215 lecture2 student(2)dannygriff1
 
Jedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented conceptsJedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented concepts
Maryo Manjaruni
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Amit Soni (CTFL)
 
Lab 4 (1).pdf
Lab 4 (1).pdfLab 4 (1).pdf
Lab 4 (1).pdf
MohammedAlobaidy16
 
Object and Classes in Java
Object and Classes in JavaObject and Classes in Java
Object and Classes in Javabackdoor
 
classandobjectunit2-150824133722-lva1-app6891.ppt
classandobjectunit2-150824133722-lva1-app6891.pptclassandobjectunit2-150824133722-lva1-app6891.ppt
classandobjectunit2-150824133722-lva1-app6891.ppt
manomkpsg
 
Object oriented programming tutorial
Object oriented programming tutorialObject oriented programming tutorial
Object oriented programming tutorial
Ghulam Abbas Khan
 
Learn C# Programming - Classes & Inheritance
Learn C# Programming - Classes & InheritanceLearn C# Programming - Classes & Inheritance
Learn C# Programming - Classes & Inheritance
Eng Teong Cheah
 
OOPS IN PHP.pptx
OOPS IN PHP.pptxOOPS IN PHP.pptx
OOPS IN PHP.pptx
rani marri
 
Use Classes with Object-Oriented Programming in C++.ppt
Use Classes with Object-Oriented Programming in C++.pptUse Classes with Object-Oriented Programming in C++.ppt
Use Classes with Object-Oriented Programming in C++.ppt
manishchoudhary91861
 
Oop
OopOop
Object oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptxObject oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptx
DaveEstonilo
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
kaavyashruthi
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
RamadossSundaramoort1
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
AnmolVerma363503
 
Class properties
Class propertiesClass properties
Class properties
Siva Priya
 

Similar to oops-123991513147-phpapp02.pdf (20)

Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
python.pptx
python.pptxpython.pptx
python.pptx
 
Php oop (1)
Php oop (1)Php oop (1)
Php oop (1)
 
Is2215 lecture2 student(2)
Is2215 lecture2 student(2)Is2215 lecture2 student(2)
Is2215 lecture2 student(2)
 
Jedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented conceptsJedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented concepts
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Lab 4 (1).pdf
Lab 4 (1).pdfLab 4 (1).pdf
Lab 4 (1).pdf
 
Object and Classes in Java
Object and Classes in JavaObject and Classes in Java
Object and Classes in Java
 
classandobjectunit2-150824133722-lva1-app6891.ppt
classandobjectunit2-150824133722-lva1-app6891.pptclassandobjectunit2-150824133722-lva1-app6891.ppt
classandobjectunit2-150824133722-lva1-app6891.ppt
 
Object oriented programming tutorial
Object oriented programming tutorialObject oriented programming tutorial
Object oriented programming tutorial
 
Learn C# Programming - Classes & Inheritance
Learn C# Programming - Classes & InheritanceLearn C# Programming - Classes & Inheritance
Learn C# Programming - Classes & Inheritance
 
OOPS IN PHP.pptx
OOPS IN PHP.pptxOOPS IN PHP.pptx
OOPS IN PHP.pptx
 
My c++
My c++My c++
My c++
 
Use Classes with Object-Oriented Programming in C++.ppt
Use Classes with Object-Oriented Programming in C++.pptUse Classes with Object-Oriented Programming in C++.ppt
Use Classes with Object-Oriented Programming in C++.ppt
 
Oop
OopOop
Oop
 
Object oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptxObject oriented programming CLASSES-AND-OBJECTS.pptx
Object oriented programming CLASSES-AND-OBJECTS.pptx
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
 
Class properties
Class propertiesClass properties
Class properties
 

Recently uploaded

134. Reviewer Certificate in Computer Science
134. Reviewer Certificate in Computer Science134. Reviewer Certificate in Computer Science
134. Reviewer Certificate in Computer Science
Manu Mitra
 
Widal Agglutination Test: A rapid serological diagnosis of typhoid fever
Widal Agglutination Test: A rapid serological diagnosis of typhoid feverWidal Agglutination Test: A rapid serological diagnosis of typhoid fever
Widal Agglutination Test: A rapid serological diagnosis of typhoid fever
taexnic
 
Personal Brand exploration KE.pdf for assignment
Personal Brand exploration KE.pdf for assignmentPersonal Brand exploration KE.pdf for assignment
Personal Brand exploration KE.pdf for assignment
ragingokie
 
Luke Royak's Personal Brand Exploration!
Luke Royak's Personal Brand Exploration!Luke Royak's Personal Brand Exploration!
Luke Royak's Personal Brand Exploration!
LukeRoyak
 
How Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
How Mentoring Elevates Your PM Career | PMI Silver Spring ChapterHow Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
How Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
Hector Del Castillo, CPM, CPMM
 
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaaInteractive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
23211a7274
 
Operating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdfOperating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdf
harikrishnahari6276
 
Full Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptxFull Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptx
mmorales2173
 
Chapters 3 Contracts.pptx Chapters 3 Contracts.pptx
Chapters 3  Contracts.pptx Chapters 3  Contracts.pptxChapters 3  Contracts.pptx Chapters 3  Contracts.pptx
Chapters 3 Contracts.pptx Chapters 3 Contracts.pptx
Sheldon Byron
 
han han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi samahan han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi sama
IrlanMalik
 
salivary gland disorders.pdf nothing more
salivary gland disorders.pdf nothing moresalivary gland disorders.pdf nothing more
salivary gland disorders.pdf nothing more
GokulnathMbbs
 
Midterm Contract Law and Adminstration.pptx
Midterm Contract Law and Adminstration.pptxMidterm Contract Law and Adminstration.pptx
Midterm Contract Law and Adminstration.pptx
Sheldon Byron
 
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
foismail170
 
欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】
欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】
欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】
foismail170
 
132. Acta Scientific Pharmaceutical Sciences
132. Acta Scientific Pharmaceutical Sciences132. Acta Scientific Pharmaceutical Sciences
132. Acta Scientific Pharmaceutical Sciences
Manu Mitra
 
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdfDOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
Pushpendra Kumar
 
Dr. Nazrul Islam, Northern University Bangladesh - CV (29.5.2024).pdf
Dr. Nazrul Islam, Northern University Bangladesh - CV (29.5.2024).pdfDr. Nazrul Islam, Northern University Bangladesh - CV (29.5.2024).pdf
Dr. Nazrul Islam, Northern University Bangladesh - CV (29.5.2024).pdf
Dr. Nazrul Islam
 
Heidi Livengood Resume Senior Technical Recruiter / HR Generalist
Heidi Livengood Resume Senior Technical Recruiter / HR GeneralistHeidi Livengood Resume Senior Technical Recruiter / HR Generalist
Heidi Livengood Resume Senior Technical Recruiter / HR Generalist
HeidiLivengood
 
133. Reviewer Certificate in Advances in Research
133. Reviewer Certificate in Advances in Research133. Reviewer Certificate in Advances in Research
133. Reviewer Certificate in Advances in Research
Manu Mitra
 
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
foismail170
 

Recently uploaded (20)

134. Reviewer Certificate in Computer Science
134. Reviewer Certificate in Computer Science134. Reviewer Certificate in Computer Science
134. Reviewer Certificate in Computer Science
 
Widal Agglutination Test: A rapid serological diagnosis of typhoid fever
Widal Agglutination Test: A rapid serological diagnosis of typhoid feverWidal Agglutination Test: A rapid serological diagnosis of typhoid fever
Widal Agglutination Test: A rapid serological diagnosis of typhoid fever
 
Personal Brand exploration KE.pdf for assignment
Personal Brand exploration KE.pdf for assignmentPersonal Brand exploration KE.pdf for assignment
Personal Brand exploration KE.pdf for assignment
 
Luke Royak's Personal Brand Exploration!
Luke Royak's Personal Brand Exploration!Luke Royak's Personal Brand Exploration!
Luke Royak's Personal Brand Exploration!
 
How Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
How Mentoring Elevates Your PM Career | PMI Silver Spring ChapterHow Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
How Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
 
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaaInteractive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
 
Operating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdfOperating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdf
 
Full Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptxFull Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptx
 
Chapters 3 Contracts.pptx Chapters 3 Contracts.pptx
Chapters 3  Contracts.pptx Chapters 3  Contracts.pptxChapters 3  Contracts.pptx Chapters 3  Contracts.pptx
Chapters 3 Contracts.pptx Chapters 3 Contracts.pptx
 
han han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi samahan han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi sama
 
salivary gland disorders.pdf nothing more
salivary gland disorders.pdf nothing moresalivary gland disorders.pdf nothing more
salivary gland disorders.pdf nothing more
 
Midterm Contract Law and Adminstration.pptx
Midterm Contract Law and Adminstration.pptxMidterm Contract Law and Adminstration.pptx
Midterm Contract Law and Adminstration.pptx
 
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
 
欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】
欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】
欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】
 
132. Acta Scientific Pharmaceutical Sciences
132. Acta Scientific Pharmaceutical Sciences132. Acta Scientific Pharmaceutical Sciences
132. Acta Scientific Pharmaceutical Sciences
 
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdfDOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
 
Dr. Nazrul Islam, Northern University Bangladesh - CV (29.5.2024).pdf
Dr. Nazrul Islam, Northern University Bangladesh - CV (29.5.2024).pdfDr. Nazrul Islam, Northern University Bangladesh - CV (29.5.2024).pdf
Dr. Nazrul Islam, Northern University Bangladesh - CV (29.5.2024).pdf
 
Heidi Livengood Resume Senior Technical Recruiter / HR Generalist
Heidi Livengood Resume Senior Technical Recruiter / HR GeneralistHeidi Livengood Resume Senior Technical Recruiter / HR Generalist
Heidi Livengood Resume Senior Technical Recruiter / HR Generalist
 
133. Reviewer Certificate in Advances in Research
133. Reviewer Certificate in Advances in Research133. Reviewer Certificate in Advances in Research
133. Reviewer Certificate in Advances in Research
 
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
 

oops-123991513147-phpapp02.pdf

  • 1. Focused more for interview Perspective and Easy Understanding
  • 2.  Object-Oriented Programming (OOP) is a software development paradigm that suggests developers to split a program in building blocks known as objects.  The OOP paradigm allows developers to define the object's data, functions, and its relationship with other objects.
  • 3.  Code Reusability  Enables to model real world object  Easy Modification  Easy Maintenance  More Flexible
  • 4.  Defines an Abstract thing of a thing (i.e. Object)  Explaining its Behavior  A user-defined data structure that groups properties and methods.  Class doesn’t occupies memory.  Class is a definition  Abstract classes are classes that can have no instances
  • 5.  A Single entity Which holds Data and Method.  It’s Structure.  Should be understandable by a non- Programmer DOG (Class) Color, Shape (Characteristic) Bark, Pee, Run (Behaviors) Members Abstract characteristics of a thing Fields - _Color Properties - Color Fields - _Color Properties - Color
  • 6.  Specify Class Name  Declare Data members  Declare Methods  Define the Processing
  • 7. Program them in the following order:  Namespace: The namespace is a keyword that defines a distinctive name or last name for the class. A namespace categorizes and organizes the library (assembly) where the class belongs and avoids collisions with classes that share the same name.  Class declaration: Line of code where the class name and type are defined.  Fields: Set of variables declared in a class block.
  • 8.  Constants: Set of constants declared in a class block.  Constructors: A method or group of methods that contains code to initialize the class.  Properties: The set of descriptive data of an object.  Events: Program responses that get fired after a user or application action.  Methods: Set of functions of the class.
  • 9.  Destructor: A method that is called when the class is destroyed.  In managed code, the Garbage Collector is in charge of destroying objects; however, in some cases developers need to take extra actions when objects are being released, such as freeing handles or de-allocating unmanaged objects.  In .NET, there is no concept of deterministic destructors. The Garbage Collector will call the Finalize() method at a non-deterministic time while reclaiming memory for the application.
  • 10.
  • 11. Access keywords  Access keywords define the access to class members from the same class and from other classes. The most common access keywords are:  Public: Allows access to the class member from any other class.  Private: Allows access to the class member only in the same class.  Protected: Allows access to the class member only within the same class and from inherited classes.
  • 12.  Internal: Allows access to the class member only in the same assembly.  Protected internal: Allows access to the class member only within the same class, from inherited classes, and other classes in the same assembly. Static: Indicates that the member can be called without first instantiating the class.
  • 13.  A particular Instance of a Class  Objects are the building blocks of OOP  Represent real world things in an abstract way  Commonly defined as variables or data structures that encapsulate behavior and data in a programmed unit  The objects will all act as independent units in their own right, and they will be responsible for carrying out a certain process
  • 14.  Object identity:  Every object is unique and can be differentiated from other objects. Each time and object is created (instantiated) the object identity is defined.  Object behavior:  What the object can do. In OOP, methods work as functions that define the set of actions that the object can do.  Object state:  The data stored within the object at any given moment. In OOP, fields, constants, and properties define the state of an object.
  • 15.  Inheritance  Abstraction  Polymorphism  Encapsulation  Event
  • 16.  Is like inheriting the abstract characteristics from other class - It is a kind of hierarchy  Base Class will be inherited to derived class  is a way to form new classes using classes that have already been defined  is-a relationships represent a hierarchy between classes of objects  Use:  Reuse of Code – uses the attributes of the base class  Extensibility – Has it’s own Attributes .Net Inheritance Concepts March 15, 2004 Brian Berejik Matt Jackson Vinnie Alwani
  • 17.  Simple / Single  Multilevel  Hierarchical  Multiple  Hybrid
  • 18.  Superclass: Parent class  Subclass: Child class  Base class: Parent class  Derived class: Child class
  • 19.  Is like inheriting from more than one base class.  .Net do not allow. But using Multiple interface inheritance this can be achieved.
  • 20.  Information Hiding  Visibility to the methods and not to the fields  E.g. A Report designer for a programmer  Packs the data and Method and protects from external tampering  Exposing only the details that are relevant: the public interface  Improves Security
  • 21.  Protected cName as string Protected Function ChangeName(NewName) Me.cName = NewName End Function
  • 22.  As we cannot hide entire object we give access to some specific part of data.  Conceptual boundaries of an object  Focuses on the essential characteristics of an object  a named entity made up of selected attributes and behavior specific to a particular usage of the originating entity  Improves Security For example see notes below
  • 23.  One entity existing in multiple forms  Behavior depends on the type of data  Same message to diff objects results in different behavior  Linked to inheritance and assures that derived class to override the implementation of parents methods.
  • 24.  Class Employee Function PayEmployee() PayEmployee = Hours * HourlyRate End Function  Class CommissionedEmployee Inherits Employee Overrides Function PayEmployee() PayEmployee = BasePay + Commissions End Function
  • 25.  Upcasting Casting an object of any type to another type which is above it in the inheritance hierarchy.  Downcasting Casting an object of any type to another type which is below it in the inheritance hierarchy. Example  Sealed Class When applied to a class, the sealed modifier prevents other classes from inheriting from it.
  • 26.  static classes and static methods are used to create data and functions that can be accessed without creating an instance of the class. class CompanyInfo { public string GetCompanyName() { return "CompanyName"; } public string GetComAddress() { return "ComAddress"; }  These methods do not need to be attached to a specific instance of the class. Therefore, instead of creating unnecessary instances of this class, you can declare it as a static class, like this: static class CompanyInfo { public static string GetCompanyName() {return "CompanyName";} public static string GetComAddress() {return "ComAddress";}
  • 27.  www.c-sharpcorner.com  www.csharpcorner.com 2  www.kuro5hin.org  www.informit.com  www.forums.asp.net  www.developerfusion.com  www.msdn.microsoft.com