SlideShare a Scribd company logo
1 of 27
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra ā€“Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
Week Target Achieved
1 50 19
2 50 22
3 50
Typing Speed
Jobs Applied
# Company Designation Applied Date Current Status
1
2
3
Oops Concept in C#
Nabeel
nabilmohad@gmail.com
nabilmohad
nabilmohad
nabilmohad
9746477551
POP OOP
In POP, program is divided into small parts
called functions.
In OOP, program is divided into parts
called objects.
POP does not have any proper way for
hiding data so it is less secure.
OOP provides Data Hiding so
provides more security.
Example of POP are : C, VB, FORTRAN,
Pascal.
Example of OOP are : C++, JAVA, VB.NET,
C#.NET.
Oops Concept in C#
ā€¢ Object Oriented Programming
language(OOPS):-
It is a methodology to write the program
where we specify the code in form of classes
and objects.
Class
ā€¢ Class is a user defined data type. it is like a
template. In c# variable are termed as instances
of classes. which are the actual objects.
Class classname
{
variable declaration;
Method declaration;
}
Object
ā€¢ Object is run time entity which has different attribute to identify it
uniquely.
Rectangle rect1=new rectangle();
Rectangle rect1=new rectangle();
Here variable 'rect1' & rect2 is object of the rectangle class.
The Method Rectangle() is the default constructor of the class. we
can create any number of objects of Rectangle class.
Basic Concept of oops:-
ā€¢ There are main three core principles of any
object oriented languages.
ā€¢ INHERITANCE
ā€¢ POLYMORPHISM
ā€¢ ENCAPSULATION
INHERITANCE:-
ā€¢ One class can include the feature of another
class by using the concept of inheritance.In c#
a class can be inherit only from one class at a
time.Whenever we create class
that automatic inherit from System.Object
class,till the time the class is not inherited
from any other class.
ā€¢ class BaseClass
ā€¢ {
ā€¢ //Method to find sum of give 2 numbers
ā€¢ public int FindSum(int x, int y)
ā€¢ {
ā€¢ return (x + y);
ā€¢ }
ā€¢ //method to print given 2 numbers
ā€¢ //When declared protected , can be accessed only from inside the derived class
ā€¢ //cannot access with the instance of derived class
ā€¢ protected void Print(int x, int y)
ā€¢ {
ā€¢ Console.WriteLine("First Number: " + x);
ā€¢ Console.WriteLine("Second Number: " + y);
ā€¢ }
ā€¢ }
ā€¢ class Derivedclass : BaseClass
ā€¢ {
ā€¢ public void Print3numbers(int x, int y, int z)
ā€¢ {
ā€¢ Print(x, y); //We can directly call baseclass
members
ā€¢ Console.WriteLine("Third Number: " + z);
ā€¢ }
ā€¢ }
ā€¢ class Program
ā€¢ {
ā€¢ static void Main(string[] args)
ā€¢ {
ā€¢ //Create instance for derived class, so that base class members
ā€¢ // can also be accessed
ā€¢ //This is possible because derivedclass is inheriting base class
ā€¢ Derivedclass instance = new Derivedclass();
ā€¢ instance.Print3numbers(30, 40, 50); //Derived class internally calls base class method.
ā€¢ int sum = instance.FindSum(30, 40); //calling base class method with derived class instance
ā€¢ Console.WriteLine("Sum : " + sum);
ā€¢ Console.Read();
ā€¢ }
ā€¢
ā€¢ }
ā€¢ Output:-
ā€¢ First number:30
ā€¢ Second number:40
ā€¢ Third number:50
ā€¢ Sum:70
ENCAPSULATION:-
ā€¢ Encapsulation is defined 'as the process of enclosing one or more
items within a physical or logical package'. Encapsulation, in object
oriented programming methodology, prevents access to
implementation details.
ā€¢ Abstraction and encapsulation are related features in object
oriented programming. Abstraction allows making relevant
information visible and encapsulation enables a programmer
to implement the desired level of abstraction.
ā€¢ Encapsulation is implemented by using access specifiers. An access
specifier defines the scope and visibility of a class member. C#
supports the following access specifiers:
ā€¢ Public
ā€¢ Private
ā€¢ Protected
POLYMORPHISM:-
ā€¢ It is also concept of oops. It is ability to take more than
one form. An operation may exhibit
different behaviour in different
situations.
ā€¢ C# gives us polymorphism through inheritance.
Inheritance-based polymorphism allows us to define
methods in a base class and override them with
derived class implementations
ā€¢ You can have multiple definitions for the same function
name in the same scope. The definition of the function
must differ from each other by the types and/or the
number of arguments in the argument list.
Function Overloading
ā€¢ class Printdata
ā€¢ {
ā€¢ void print(int i)
ā€¢ {
ā€¢ Console.WriteLine("Printing int: {0}", i);
ā€¢ }
ā€¢ void print(double f)
ā€¢ {
ā€¢ Console.WriteLine("Printing float: {0}", f);
ā€¢ }
ā€¢ void print(string s)
ā€¢ {
ā€¢ Console.WriteLine("Printing string: {0}", s);
ā€¢ }
ā€¢ static void Main(string[] args)
ā€¢ {
ā€¢ Printdata p = new Printdata();
ā€¢ // Call print to print integer
ā€¢ p.print(5);
ā€¢ // Call print to print float
ā€¢ p.print(500.263);
ā€¢ // Call print to print string
ā€¢ p.print("Hello C++");
ā€¢ Console.ReadKey();
ā€¢ }
ā€¢ }
ā€¢ Output:-
ā€¢ Printing int: 5
ā€¢ Printing float: 500.263
ā€¢ Printing string: Hello C++
Override
ā€¢ class Color
ā€¢ {
ā€¢ public virtual void Fill()
ā€¢ {
ā€¢ Console.WriteLine("Fill me up with color");
ā€¢ }
ā€¢ public void Fill(string s)
ā€¢ {
ā€¢ Console.WriteLine("Fill me up with {0}", s);
ā€¢ }
ā€¢ }
ā€¢ class Green : Color
ā€¢ {
ā€¢ public override void Fill()
ā€¢ {
ā€¢ Console.WriteLine("Fill me up with green");
ā€¢ }
ā€¢ }
ā€¢ class nab
ā€¢ {
ā€¢ static void Main()
ā€¢ {
ā€¢ Green c1 = new Green();
ā€¢ c1.Fill();
ā€¢ c1.Fill("red");
ā€¢ Console.Read();
ā€¢ }
ā€¢
ā€¢ }
ā€¢ Out put:
ā€¢ Fillup with Green
ā€¢ Fillup with Red
Dynamic Polymorphism
ā€¢ C# allows you to create abstract classes that are used
to provide partial class implementation of an interface.
Implementation is completed when a derived class
inherits from it. Abstract classes contain abstract
methods which are implemented by the derived class.
The derived classes have more specialized
functionality.
ā€¢ Please note the following rules about abstract classes:
ā€¢ You cannot create an instance of an abstract class
ā€¢ You cannot declare an abstract method outside an
abstract class
ā€¢ When a class is declared sealed, it cannot be inherited,
abstract classes cannot be declared sealed.
ā€¢ abstract class Shape
ā€¢ {
ā€¢
ā€¢ public abstract int area();
ā€¢
ā€¢ }
ā€¢ class Rectangle: Shape
ā€¢ {
ā€¢ private int length;
ā€¢ private int width;
ā€¢ public Rectangle( int a, int b)
ā€¢ {
ā€¢ length = a;
ā€¢ width = b;
ā€¢ }
ā€¢ public override int area ()
ā€¢ {
ā€¢ Console.WriteLine("Rectangle class area :");
ā€¢ return (width * length);
ā€¢ }
ā€¢ }
ā€¢ class RectangleTester
ā€¢ {
ā€¢ static void Main(string[] args)
ā€¢ {
ā€¢ Rectangle r = new Rectangle(10, 7);
ā€¢ double a = r.area();
ā€¢ Console.WriteLine("Area: {0}",a);
ā€¢ Console.ReadKey();
ā€¢ }
ā€¢ }
ā€¢ Out put:
ā€¢ Rectangle class area :
ā€¢ Area:70
Abstract Classes and Class Members
ā€¢ The purpose of an abstract class is to provide a
common definition of a base class that multiple
derived classes can share. For example, a class library
may define an abstract class that is used as a
parameter to many of its functions, and require
programmers using that library to provide their own
implementation of the class by creating a derived class.
ā€¢ Abstract classes may also define abstract methods. This
is accomplished by adding the keyword abstract before
the return type of the method. For example:
sealed
ā€¢ When applied to a class, the sealed modifier
prevents other classes from inheriting from it.
ā€¢ When you define new methods or properties
in a class, you can prevent deriving classes
from overriding them by not declaring them
as virtual.
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 ā€“ 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 ā€“ 495 40 25 550
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com

More Related Content

What's hot

Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Michelle Anne Meralpis
Ā 
Access modifiers
Access modifiersAccess modifiers
Access modifiersJadavsejal
Ā 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Aijaz Ali Abro
Ā 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVAAbhilash Nair
Ā 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .NetGreg Sohl
Ā 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#SAMIR BHOGAYTA
Ā 
Java collections concept
Java collections conceptJava collections concept
Java collections conceptkumar gaurav
Ā 
OOP java
OOP javaOOP java
OOP javaxball977
Ā 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp PresentationVishwa Mohan
Ā 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in JavaAbhilash Nair
Ā 

What's hot (20)

Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Ā 
Access modifiers
Access modifiersAccess modifiers
Access modifiers
Ā 
Inheritance C#
Inheritance C#Inheritance C#
Inheritance C#
Ā 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
Ā 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
Ā 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
Ā 
C# basics
 C# basics C# basics
C# basics
Ā 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
Ā 
Dot net assembly
Dot net assemblyDot net assembly
Dot net assembly
Ā 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#
Ā 
Java collections concept
Java collections conceptJava collections concept
Java collections concept
Ā 
OOP java
OOP javaOOP java
OOP java
Ā 
Methods in Java
Methods in JavaMethods in Java
Methods in Java
Ā 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
Ā 
Python programming : Abstract classes interfaces
Python programming : Abstract classes interfacesPython programming : Abstract classes interfaces
Python programming : Abstract classes interfaces
Ā 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
Ā 
Oop
OopOop
Oop
Ā 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
Ā 
C# Access modifiers
C# Access modifiersC# Access modifiers
C# Access modifiers
Ā 
OOPs in Java
OOPs in JavaOOPs in Java
OOPs in Java
Ā 

Viewers also liked

Object-oriented programming
Object-oriented programmingObject-oriented programming
Object-oriented programmingNeelesh Shukla
Ā 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
Ā 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial Jm Ramos
Ā 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingMoutaz Haddara
Ā 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# IntroductionSiraj Memon
Ā 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental PrinciplesIntro C# Book
Ā 
ROI sofort - Enterprise 2.0 auf Basis von Lotus Notes und Domino
ROI sofort -  Enterprise 2.0 auf Basis von Lotus Notes und DominoROI sofort -  Enterprise 2.0 auf Basis von Lotus Notes und Domino
ROI sofort - Enterprise 2.0 auf Basis von Lotus Notes und DominoThomas Bahn
Ā 
Simply - OOP - Simply
Simply - OOP - SimplySimply - OOP - Simply
Simply - OOP - SimplyThomas Bahn
Ā 
Object Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaObject Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaGlenn Guden
Ā 
Object oriented programming by Waqas
Object oriented programming by WaqasObject oriented programming by Waqas
Object oriented programming by WaqasWaqas !!!!
Ā 
Project object explain your choice
Project object   explain your choiceProject object   explain your choice
Project object explain your choiceSoren
Ā 
Windows storemindcrcaker23rdmarch
Windows storemindcrcaker23rdmarchWindows storemindcrcaker23rdmarch
Windows storemindcrcaker23rdmarchDhananjay Kumar
Ā 
Basic powershell scripts
Basic powershell scriptsBasic powershell scripts
Basic powershell scriptsMOHD TAHIR
Ā 
Inline function(oops)
Inline function(oops)Inline function(oops)
Inline function(oops)Jay Patel
Ā 
OOP Basic
OOP BasicOOP Basic
OOP BasicYeti Sno
Ā 

Viewers also liked (20)

OOP with C#
OOP with C#OOP with C#
OOP with C#
Ā 
Oops ppt
Oops pptOops ppt
Oops ppt
Ā 
Object-oriented programming
Object-oriented programmingObject-oriented programming
Object-oriented programming
Ā 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
Ā 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial
Ā 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
Ā 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# Introduction
Ā 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles
Ā 
ROI sofort - Enterprise 2.0 auf Basis von Lotus Notes und Domino
ROI sofort -  Enterprise 2.0 auf Basis von Lotus Notes und DominoROI sofort -  Enterprise 2.0 auf Basis von Lotus Notes und Domino
ROI sofort - Enterprise 2.0 auf Basis von Lotus Notes und Domino
Ā 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
Ā 
Simply - OOP - Simply
Simply - OOP - SimplySimply - OOP - Simply
Simply - OOP - Simply
Ā 
Object Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaObject Oriented Programming Concepts using Java
Object Oriented Programming Concepts using Java
Ā 
Object oriented programming by Waqas
Object oriented programming by WaqasObject oriented programming by Waqas
Object oriented programming by Waqas
Ā 
Project object explain your choice
Project object   explain your choiceProject object   explain your choice
Project object explain your choice
Ā 
Windows storemindcrcaker23rdmarch
Windows storemindcrcaker23rdmarchWindows storemindcrcaker23rdmarch
Windows storemindcrcaker23rdmarch
Ā 
Basic powershell scripts
Basic powershell scriptsBasic powershell scripts
Basic powershell scripts
Ā 
Inline function(oops)
Inline function(oops)Inline function(oops)
Inline function(oops)
Ā 
C# String
C# StringC# String
C# String
Ā 
OOP Basic
OOP BasicOOP Basic
OOP Basic
Ā 
Basics of oops concept
Basics of oops conceptBasics of oops concept
Basics of oops concept
Ā 

Similar to Oops concept on c#

Presentation 1st
Presentation 1stPresentation 1st
Presentation 1stConnex
Ā 
Objective-C for iOS Application Development
Objective-C for iOS Application DevelopmentObjective-C for iOS Application Development
Objective-C for iOS Application DevelopmentDhaval Kaneria
Ā 
UNIT3 on object oriented programming.pptx
UNIT3 on object oriented programming.pptxUNIT3 on object oriented programming.pptx
UNIT3 on object oriented programming.pptxurvashipundir04
Ā 
introduction to c #
introduction to c #introduction to c #
introduction to c #Sireesh K
Ā 
Presentation 3rd
Presentation 3rdPresentation 3rd
Presentation 3rdConnex
Ā 
Object oriented programming in C++
Object oriented programming in C++Object oriented programming in C++
Object oriented programming in C++jehan1987
Ā 
I assignmnt(oops)
I assignmnt(oops)I assignmnt(oops)
I assignmnt(oops)Jay Patel
Ā 
Constructor
ConstructorConstructor
Constructorabhay singh
Ā 
Lecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptxLecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptxShaownRoy1
Ā 
Learning C++ - Class 4
Learning C++ - Class 4Learning C++ - Class 4
Learning C++ - Class 4Ali Aminian
Ā 
Csharp introduction
Csharp introductionCsharp introduction
Csharp introductionSireesh K
Ā 
Introduction to objective c
Introduction to objective cIntroduction to objective c
Introduction to objective cSunny Shaikh
Ā 
Oop(object oriented programming)
Oop(object oriented programming)Oop(object oriented programming)
Oop(object oriented programming)geetika goyal
Ā 
C# (This keyword, Properties, Inheritance, Base Keyword)
C# (This keyword, Properties, Inheritance, Base Keyword)C# (This keyword, Properties, Inheritance, Base Keyword)
C# (This keyword, Properties, Inheritance, Base Keyword)Umar Farooq
Ā 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.Tarunsingh198
Ā 
class and object C++ language chapter 2.pptx
class and object C++ language chapter 2.pptxclass and object C++ language chapter 2.pptx
class and object C++ language chapter 2.pptxAshrithaRokkam
Ā 
UNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year csUNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year csjaved75
Ā 

Similar to Oops concept on c# (20)

Presentation 1st
Presentation 1stPresentation 1st
Presentation 1st
Ā 
Objective-C for iOS Application Development
Objective-C for iOS Application DevelopmentObjective-C for iOS Application Development
Objective-C for iOS Application Development
Ā 
UNIT3 on object oriented programming.pptx
UNIT3 on object oriented programming.pptxUNIT3 on object oriented programming.pptx
UNIT3 on object oriented programming.pptx
Ā 
introduction to c #
introduction to c #introduction to c #
introduction to c #
Ā 
Presentation 3rd
Presentation 3rdPresentation 3rd
Presentation 3rd
Ā 
Object oriented programming in C++
Object oriented programming in C++Object oriented programming in C++
Object oriented programming in C++
Ā 
I assignmnt(oops)
I assignmnt(oops)I assignmnt(oops)
I assignmnt(oops)
Ā 
Constructor
ConstructorConstructor
Constructor
Ā 
C#2
C#2C#2
C#2
Ā 
Lecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptxLecture-10_PHP-OOP.pptx
Lecture-10_PHP-OOP.pptx
Ā 
Python_Unit_2 OOPS.pptx
Python_Unit_2  OOPS.pptxPython_Unit_2  OOPS.pptx
Python_Unit_2 OOPS.pptx
Ā 
Learning C++ - Class 4
Learning C++ - Class 4Learning C++ - Class 4
Learning C++ - Class 4
Ā 
Csharp introduction
Csharp introductionCsharp introduction
Csharp introduction
Ā 
Introduction to objective c
Introduction to objective cIntroduction to objective c
Introduction to objective c
Ā 
c++ Unit I.pptx
c++ Unit I.pptxc++ Unit I.pptx
c++ Unit I.pptx
Ā 
Oop(object oriented programming)
Oop(object oriented programming)Oop(object oriented programming)
Oop(object oriented programming)
Ā 
C# (This keyword, Properties, Inheritance, Base Keyword)
C# (This keyword, Properties, Inheritance, Base Keyword)C# (This keyword, Properties, Inheritance, Base Keyword)
C# (This keyword, Properties, Inheritance, Base Keyword)
Ā 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.
Ā 
class and object C++ language chapter 2.pptx
class and object C++ language chapter 2.pptxclass and object C++ language chapter 2.pptx
class and object C++ language chapter 2.pptx
Ā 
UNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year csUNIT-IV WT web technology for 1st year cs
UNIT-IV WT web technology for 1st year cs
Ā 

More from baabtra.com - No. 1 supplier of quality freshers

More from baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
Ā 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
Ā 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
Ā 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
Ā 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
Ā 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
Ā 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
Ā 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
Ā 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
Ā 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
Ā 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
Ā 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Ā 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
Ā 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
Ā 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
Ā 
Blue brain
Blue brainBlue brain
Blue brain
Ā 
5g
5g5g
5g
Ā 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
Ā 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
Ā 
Baabtra soft skills
Baabtra soft skillsBaabtra soft skills
Baabtra soft skills
Ā 

Recently uploaded

ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
Ā 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
Ā 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
Ā 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
Ā 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
Ā 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
Ā 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
Ā 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
Ā 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A BeƱa
Ā 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
Ā 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
Ā 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
Ā 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
Ā 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A BeƱa
Ā 
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...Nguyen Thanh Tu Collection
Ā 

Recently uploaded (20)

OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
Ā 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
Ā 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
Ā 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
Ā 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
Ā 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
Ā 
Model Call Girl in Tilak Nagar Delhi reach out to us at šŸ”9953056974šŸ”
Model Call Girl in Tilak Nagar Delhi reach out to us at šŸ”9953056974šŸ”Model Call Girl in Tilak Nagar Delhi reach out to us at šŸ”9953056974šŸ”
Model Call Girl in Tilak Nagar Delhi reach out to us at šŸ”9953056974šŸ”
Ā 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
Ā 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
Ā 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
Ā 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
Ā 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
Ā 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
Ā 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
Ā 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
Ā 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
Ā 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
Ā 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
Ā 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
Ā 
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Ā 

Oops concept on c#

  • 1.
  • 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra ā€“Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 3. Week Target Achieved 1 50 19 2 50 22 3 50 Typing Speed
  • 4. Jobs Applied # Company Designation Applied Date Current Status 1 2 3
  • 5. Oops Concept in C# Nabeel nabilmohad@gmail.com nabilmohad nabilmohad nabilmohad 9746477551
  • 6. POP OOP In POP, program is divided into small parts called functions. In OOP, program is divided into parts called objects. POP does not have any proper way for hiding data so it is less secure. OOP provides Data Hiding so provides more security. Example of POP are : C, VB, FORTRAN, Pascal. Example of OOP are : C++, JAVA, VB.NET, C#.NET.
  • 7. Oops Concept in C# ā€¢ Object Oriented Programming language(OOPS):- It is a methodology to write the program where we specify the code in form of classes and objects.
  • 8. Class ā€¢ Class is a user defined data type. it is like a template. In c# variable are termed as instances of classes. which are the actual objects. Class classname { variable declaration; Method declaration; }
  • 9. Object ā€¢ Object is run time entity which has different attribute to identify it uniquely. Rectangle rect1=new rectangle(); Rectangle rect1=new rectangle(); Here variable 'rect1' & rect2 is object of the rectangle class. The Method Rectangle() is the default constructor of the class. we can create any number of objects of Rectangle class.
  • 10. Basic Concept of oops:- ā€¢ There are main three core principles of any object oriented languages. ā€¢ INHERITANCE ā€¢ POLYMORPHISM ā€¢ ENCAPSULATION
  • 11. INHERITANCE:- ā€¢ One class can include the feature of another class by using the concept of inheritance.In c# a class can be inherit only from one class at a time.Whenever we create class that automatic inherit from System.Object class,till the time the class is not inherited from any other class.
  • 12. ā€¢ class BaseClass ā€¢ { ā€¢ //Method to find sum of give 2 numbers ā€¢ public int FindSum(int x, int y) ā€¢ { ā€¢ return (x + y); ā€¢ } ā€¢ //method to print given 2 numbers ā€¢ //When declared protected , can be accessed only from inside the derived class ā€¢ //cannot access with the instance of derived class ā€¢ protected void Print(int x, int y) ā€¢ { ā€¢ Console.WriteLine("First Number: " + x); ā€¢ Console.WriteLine("Second Number: " + y); ā€¢ } ā€¢ }
  • 13. ā€¢ class Derivedclass : BaseClass ā€¢ { ā€¢ public void Print3numbers(int x, int y, int z) ā€¢ { ā€¢ Print(x, y); //We can directly call baseclass members ā€¢ Console.WriteLine("Third Number: " + z); ā€¢ } ā€¢ }
  • 14. ā€¢ class Program ā€¢ { ā€¢ static void Main(string[] args) ā€¢ { ā€¢ //Create instance for derived class, so that base class members ā€¢ // can also be accessed ā€¢ //This is possible because derivedclass is inheriting base class ā€¢ Derivedclass instance = new Derivedclass(); ā€¢ instance.Print3numbers(30, 40, 50); //Derived class internally calls base class method. ā€¢ int sum = instance.FindSum(30, 40); //calling base class method with derived class instance ā€¢ Console.WriteLine("Sum : " + sum); ā€¢ Console.Read(); ā€¢ } ā€¢ ā€¢ }
  • 15. ā€¢ Output:- ā€¢ First number:30 ā€¢ Second number:40 ā€¢ Third number:50 ā€¢ Sum:70
  • 16. ENCAPSULATION:- ā€¢ Encapsulation is defined 'as the process of enclosing one or more items within a physical or logical package'. Encapsulation, in object oriented programming methodology, prevents access to implementation details. ā€¢ Abstraction and encapsulation are related features in object oriented programming. Abstraction allows making relevant information visible and encapsulation enables a programmer to implement the desired level of abstraction. ā€¢ Encapsulation is implemented by using access specifiers. An access specifier defines the scope and visibility of a class member. C# supports the following access specifiers: ā€¢ Public ā€¢ Private ā€¢ Protected
  • 17. POLYMORPHISM:- ā€¢ It is also concept of oops. It is ability to take more than one form. An operation may exhibit different behaviour in different situations. ā€¢ C# gives us polymorphism through inheritance. Inheritance-based polymorphism allows us to define methods in a base class and override them with derived class implementations ā€¢ You can have multiple definitions for the same function name in the same scope. The definition of the function must differ from each other by the types and/or the number of arguments in the argument list.
  • 18. Function Overloading ā€¢ class Printdata ā€¢ { ā€¢ void print(int i) ā€¢ { ā€¢ Console.WriteLine("Printing int: {0}", i); ā€¢ } ā€¢ void print(double f) ā€¢ { ā€¢ Console.WriteLine("Printing float: {0}", f); ā€¢ } ā€¢ void print(string s) ā€¢ { ā€¢ Console.WriteLine("Printing string: {0}", s); ā€¢ } ā€¢ static void Main(string[] args) ā€¢ { ā€¢ Printdata p = new Printdata(); ā€¢ // Call print to print integer ā€¢ p.print(5); ā€¢ // Call print to print float ā€¢ p.print(500.263); ā€¢ // Call print to print string ā€¢ p.print("Hello C++"); ā€¢ Console.ReadKey(); ā€¢ } ā€¢ }
  • 19. ā€¢ Output:- ā€¢ Printing int: 5 ā€¢ Printing float: 500.263 ā€¢ Printing string: Hello C++
  • 20. Override ā€¢ class Color ā€¢ { ā€¢ public virtual void Fill() ā€¢ { ā€¢ Console.WriteLine("Fill me up with color"); ā€¢ } ā€¢ public void Fill(string s) ā€¢ { ā€¢ Console.WriteLine("Fill me up with {0}", s); ā€¢ } ā€¢ } ā€¢ class Green : Color ā€¢ { ā€¢ public override void Fill() ā€¢ { ā€¢ Console.WriteLine("Fill me up with green"); ā€¢ } ā€¢ } ā€¢ class nab ā€¢ { ā€¢ static void Main() ā€¢ { ā€¢ Green c1 = new Green(); ā€¢ c1.Fill(); ā€¢ c1.Fill("red"); ā€¢ Console.Read(); ā€¢ } ā€¢ ā€¢ } ā€¢ Out put: ā€¢ Fillup with Green ā€¢ Fillup with Red
  • 21. Dynamic Polymorphism ā€¢ C# allows you to create abstract classes that are used to provide partial class implementation of an interface. Implementation is completed when a derived class inherits from it. Abstract classes contain abstract methods which are implemented by the derived class. The derived classes have more specialized functionality. ā€¢ Please note the following rules about abstract classes: ā€¢ You cannot create an instance of an abstract class ā€¢ You cannot declare an abstract method outside an abstract class ā€¢ When a class is declared sealed, it cannot be inherited, abstract classes cannot be declared sealed.
  • 22. ā€¢ abstract class Shape ā€¢ { ā€¢ ā€¢ public abstract int area(); ā€¢ ā€¢ } ā€¢ class Rectangle: Shape ā€¢ { ā€¢ private int length; ā€¢ private int width; ā€¢ public Rectangle( int a, int b) ā€¢ { ā€¢ length = a; ā€¢ width = b; ā€¢ } ā€¢ public override int area () ā€¢ { ā€¢ Console.WriteLine("Rectangle class area :"); ā€¢ return (width * length); ā€¢ } ā€¢ } ā€¢ class RectangleTester ā€¢ { ā€¢ static void Main(string[] args) ā€¢ { ā€¢ Rectangle r = new Rectangle(10, 7); ā€¢ double a = r.area(); ā€¢ Console.WriteLine("Area: {0}",a); ā€¢ Console.ReadKey(); ā€¢ } ā€¢ } ā€¢ Out put: ā€¢ Rectangle class area : ā€¢ Area:70
  • 23. Abstract Classes and Class Members ā€¢ The purpose of an abstract class is to provide a common definition of a base class that multiple derived classes can share. For example, a class library may define an abstract class that is used as a parameter to many of its functions, and require programmers using that library to provide their own implementation of the class by creating a derived class. ā€¢ Abstract classes may also define abstract methods. This is accomplished by adding the keyword abstract before the return type of the method. For example:
  • 24. sealed ā€¢ When applied to a class, the sealed modifier prevents other classes from inheriting from it. ā€¢ When you define new methods or properties in a class, you can prevent deriving classes from overriding them by not declaring them as virtual.
  • 25.
  • 26. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  • 27. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 ā€“ 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 ā€“ 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com