SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
Class and Method
           Programming in C#




              tnngo2@gmail.com
Class and Objects
Object-oriented programming

      Programming languages designed based on data and ways to
      manipulate data.

      Procedural Languages (Pascal, C) focus on ways


      Object-oriented Languages (C#, Java) focus on data
Features

      Abstraction
      Encapsulation
      Inheritance
      Polymorphism


                      Focus only the required information from objects
Features

      Abstraction

      Encapsulation
      Inheritance
      Polymorphism



                      Hide details of what a class contains
Features

      Abstraction

      Encapsulation

      Inheritance
      Polymorphism


                      Create a new class based on the attributes
                      and methods of an existing class
Features

      Abstraction

      Encapsulation
      Inheritance

      Polymorphism

                      Behave differently in different situations
Class
Class – should & cannot

      Should
               be a noun
               first letter capitalized
               simple, descriptive, meaningful
      Cannot
               in mixed case
               C# keyword
               begin with a digit except @, _
Methods
Method – can & cannot

     Can
           begin with a letter, _ or @
     Cannot
           C# keyword
           contain space
           begin with digit
Invoking methods

      https://gist.github.com/2349623
Static methods

      called without creating any objects of the class
      refer only to static variables and other static methods of class.

      https://gist.github.com/2349658
Static methods

      Only one copy of static variable is shared by all the objects of the
      class.
Question?

     https://gist.github.com/2349708
Access Modifiers
Access Modifiers
Ref

      causes arguments to be passed in a method by reference


      https://gist.github.com/2344456
Out

      similar to ref but no
                          required the variables that are passed by
      reference to be initialized

      https://gist.github.com/2344483
Method overloading
Method overloading

      every method has a signature which comprises
              the number of params
              the data types of params
              the order of params
Should and avoid

      Methods to be overloaded should perform the same task

      The signatures of the overloaded must be unique

      Return type is not a part of the signature

      The ref and out parameters can be included as a part of the
      signature
This keyword

      refer to the current object of the class.

      cannot use this keyword with static variables and method

      https://gist.github.com/2344534
Question?

     https://gist.github.com/2349708
Constructors and Destructors
Constructors

      initialization

      no return type

      possible to have overloaded constructors

      https://gist.github.com/2344570
Default Constructors

      C# creates a default constructors for a class if no constructor is
      specified within the class. It automatically initializes all the numeric
      data type instance variables to zero.

      If you define a constructor in the class, the default constructor is no
      longer used.
Static Constructors

      initialize static variables of the class and to perform a particular
      action only once.

      is invoked before any static member of the class is accessed.

      does not take any parameters and does not use any access modifiers
      because it is invoked directly by the CLR instead of the object.

      Certainly, cannot access non-static data member.

      https://gist.github.com/2344643
Constructor Overloading


      https://gist.github.com/2344673
Destructors

      invoked automatically when the objects are not in use

      only one destructor in a class

      cannot be overloaded or inherited

      cannot be explicitly invoked


      cannot specify access modifiers and cannot take parameters

      https://gist.github.com/2344708
Garbage Collector

Weitere ähnliche Inhalte

Was ist angesagt?

C#, OOP introduction and examples
C#, OOP introduction and examplesC#, OOP introduction and examples
C#, OOP introduction and examplesagni_agbc
 
Object Oriented Programming - Basic Concepts
Object Oriented Programming - Basic ConceptsObject Oriented Programming - Basic Concepts
Object Oriented Programming - Basic ConceptsArunkumar Kupppuswamy
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented PrinciplesSujit Majety
 
4- Inheritance, Aggregation, Encapsulation and Overloading
4- Inheritance, Aggregation, Encapsulation and Overloading4- Inheritance, Aggregation, Encapsulation and Overloading
4- Inheritance, Aggregation, Encapsulation and OverloadingGhadeer AlHasan
 
Polymorphism presentation in java
Polymorphism presentation in javaPolymorphism presentation in java
Polymorphism presentation in javaAhsan Raja
 
Abap Inicio
Abap InicioAbap Inicio
Abap Iniciounifor
 
OOP in C#
OOP in C#OOP in C#
OOP in C#DevMix
 
Evolution of c# - by K.Jegan
Evolution of c# - by K.JeganEvolution of c# - by K.Jegan
Evolution of c# - by K.Jegantalenttransform
 
Abstract Class Presentation
Abstract Class PresentationAbstract Class Presentation
Abstract Class Presentationtigerwarn
 
OCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference CardOCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference CardHari kiran G
 
8abstact class in c#
8abstact class in c#8abstact class in c#
8abstact class in c#Sireesh K
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statementsİbrahim Kürce
 

Was ist angesagt? (20)

C#
C#C#
C#
 
C#, OOP introduction and examples
C#, OOP introduction and examplesC#, OOP introduction and examples
C#, OOP introduction and examples
 
Object Oriented Programming - Basic Concepts
Object Oriented Programming - Basic ConceptsObject Oriented Programming - Basic Concepts
Object Oriented Programming - Basic Concepts
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented Principles
 
4- Inheritance, Aggregation, Encapsulation and Overloading
4- Inheritance, Aggregation, Encapsulation and Overloading4- Inheritance, Aggregation, Encapsulation and Overloading
4- Inheritance, Aggregation, Encapsulation and Overloading
 
Total oop in c# dot net
Total oop in c# dot netTotal oop in c# dot net
Total oop in c# dot net
 
Polymorphism presentation in java
Polymorphism presentation in javaPolymorphism presentation in java
Polymorphism presentation in java
 
Abap Inicio
Abap InicioAbap Inicio
Abap Inicio
 
Lecture 18
Lecture 18Lecture 18
Lecture 18
 
C# interview quesions
C# interview quesionsC# interview quesions
C# interview quesions
 
OOP in C#
OOP in C#OOP in C#
OOP in C#
 
C# interview questions
C# interview questionsC# interview questions
C# interview questions
 
Evolution of c# - by K.Jegan
Evolution of c# - by K.JeganEvolution of c# - by K.Jegan
Evolution of c# - by K.Jegan
 
Abstract Class Presentation
Abstract Class PresentationAbstract Class Presentation
Abstract Class Presentation
 
OCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference CardOCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference Card
 
C# interview
C# interviewC# interview
C# interview
 
Deciphering the Ruby Object Model
Deciphering the Ruby Object ModelDeciphering the Ruby Object Model
Deciphering the Ruby Object Model
 
8abstact class in c#
8abstact class in c#8abstact class in c#
8abstact class in c#
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statements
 

Andere mochten auch

Delação de Sérgio Machado na íntegra
Delação de Sérgio Machado na íntegraDelação de Sérgio Machado na íntegra
Delação de Sérgio Machado na íntegraMiguel Rosario
 
Overview of the Virginia Education Wizard
Overview of the Virginia Education WizardOverview of the Virginia Education Wizard
Overview of the Virginia Education Wizardchjensen
 
Carta descriptiva wiki
Carta descriptiva wikiCarta descriptiva wiki
Carta descriptiva wikiairamm87
 
Mass, Volume and Density Labs --Day 1
Mass, Volume and Density Labs --Day 1Mass, Volume and Density Labs --Day 1
Mass, Volume and Density Labs --Day 1jmori1
 
Managing Community Open Source Brands
Managing Community Open Source BrandsManaging Community Open Source Brands
Managing Community Open Source BrandsShane Curcuru
 
PHP Sessions and Non-Sessions
PHP Sessions and Non-SessionsPHP Sessions and Non-Sessions
PHP Sessions and Non-SessionsSven Rautenberg
 
Growing your school in troubled times, sbacs webinar
Growing your school in troubled times, sbacs webinarGrowing your school in troubled times, sbacs webinar
Growing your school in troubled times, sbacs webinarRick Newberry
 
Asia pacopenstack swiftstack-joe-arnold-2012-08-11
Asia pacopenstack swiftstack-joe-arnold-2012-08-11Asia pacopenstack swiftstack-joe-arnold-2012-08-11
Asia pacopenstack swiftstack-joe-arnold-2012-08-11OpenCity Community
 
KVH Carrier Solutions
KVH Carrier SolutionsKVH Carrier Solutions
KVH Carrier SolutionsKVH Co. Ltd.
 
Lesson 3
Lesson 3Lesson 3
Lesson 3hstryk
 
Yellow Umbrella Services Pvt. Ltd
Yellow Umbrella Services Pvt. LtdYellow Umbrella Services Pvt. Ltd
Yellow Umbrella Services Pvt. LtdYellow Umbrella
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for CassandraEdward Capriolo
 
Final project for eme 2040
Final project for eme 2040Final project for eme 2040
Final project for eme 2040ellapeters92
 
Manifesto do Congresso Internacional realizado na Unesp Bauru
Manifesto do Congresso Internacional realizado na Unesp BauruManifesto do Congresso Internacional realizado na Unesp Bauru
Manifesto do Congresso Internacional realizado na Unesp BauruMiguel Rosario
 

Andere mochten auch (20)

Delação de Sérgio Machado na íntegra
Delação de Sérgio Machado na íntegraDelação de Sérgio Machado na íntegra
Delação de Sérgio Machado na íntegra
 
Overview of the Virginia Education Wizard
Overview of the Virginia Education WizardOverview of the Virginia Education Wizard
Overview of the Virginia Education Wizard
 
Carta descriptiva wiki
Carta descriptiva wikiCarta descriptiva wiki
Carta descriptiva wiki
 
Mass, Volume and Density Labs --Day 1
Mass, Volume and Density Labs --Day 1Mass, Volume and Density Labs --Day 1
Mass, Volume and Density Labs --Day 1
 
Managing Community Open Source Brands
Managing Community Open Source BrandsManaging Community Open Source Brands
Managing Community Open Source Brands
 
PHP Sessions and Non-Sessions
PHP Sessions and Non-SessionsPHP Sessions and Non-Sessions
PHP Sessions and Non-Sessions
 
Growing your school in troubled times, sbacs webinar
Growing your school in troubled times, sbacs webinarGrowing your school in troubled times, sbacs webinar
Growing your school in troubled times, sbacs webinar
 
Asia pacopenstack swiftstack-joe-arnold-2012-08-11
Asia pacopenstack swiftstack-joe-arnold-2012-08-11Asia pacopenstack swiftstack-joe-arnold-2012-08-11
Asia pacopenstack swiftstack-joe-arnold-2012-08-11
 
Track
TrackTrack
Track
 
Ig3 2012_assignment
 Ig3 2012_assignment Ig3 2012_assignment
Ig3 2012_assignment
 
KVH Carrier Solutions
KVH Carrier SolutionsKVH Carrier Solutions
KVH Carrier Solutions
 
Lesson 3
Lesson 3Lesson 3
Lesson 3
 
Yellow Umbrella Services Pvt. Ltd
Yellow Umbrella Services Pvt. LtdYellow Umbrella Services Pvt. Ltd
Yellow Umbrella Services Pvt. Ltd
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for Cassandra
 
Final project for eme 2040
Final project for eme 2040Final project for eme 2040
Final project for eme 2040
 
Manifesto do Congresso Internacional realizado na Unesp Bauru
Manifesto do Congresso Internacional realizado na Unesp BauruManifesto do Congresso Internacional realizado na Unesp Bauru
Manifesto do Congresso Internacional realizado na Unesp Bauru
 
Brics
BricsBrics
Brics
 
Sambo
Sambo Sambo
Sambo
 
Startgids Medewerker
Startgids MedewerkerStartgids Medewerker
Startgids Medewerker
 
Data Collection
Data CollectionData Collection
Data Collection
 

Ähnlich wie 6 class and methods

Ähnlich wie 6 class and methods (20)

Object-oriented programming 3.pptx
Object-oriented programming 3.pptxObject-oriented programming 3.pptx
Object-oriented programming 3.pptx
 
Python_Unit_3.pdf
Python_Unit_3.pdfPython_Unit_3.pdf
Python_Unit_3.pdf
 
LectureNotes-02-DSA
LectureNotes-02-DSALectureNotes-02-DSA
LectureNotes-02-DSA
 
Object Oriented Programming C#
Object Oriented Programming C#Object Oriented Programming C#
Object Oriented Programming C#
 
PPT Lecture-1.4.pptx
PPT Lecture-1.4.pptxPPT Lecture-1.4.pptx
PPT Lecture-1.4.pptx
 
Java
JavaJava
Java
 
java tutorial 4
 java tutorial 4 java tutorial 4
java tutorial 4
 
Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5
 
Presentation 3rd
Presentation 3rdPresentation 3rd
Presentation 3rd
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview Qestions
 
7 inheritance and polymorphism
7   inheritance and polymorphism7   inheritance and polymorphism
7 inheritance and polymorphism
 
Java session2
Java session2Java session2
Java session2
 
C# - Igor Ralić
C# - Igor RalićC# - Igor Ralić
C# - Igor Ralić
 
Java scjp-part1
Java scjp-part1Java scjp-part1
Java scjp-part1
 
Classes2
Classes2Classes2
Classes2
 
C# classes objects
C#  classes objectsC#  classes objects
C# classes objects
 
Application package
Application packageApplication package
Application package
 
Code Refactoring
Code RefactoringCode Refactoring
Code Refactoring
 
116824015 java-j2 ee
116824015 java-j2 ee116824015 java-j2 ee
116824015 java-j2 ee
 
Java OOPs
Java OOPs Java OOPs
Java OOPs
 

Mehr von Tuan Ngo

Introduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 enIntroduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 enTuan Ngo
 
Net framework
Net frameworkNet framework
Net frameworkTuan Ngo
 
15 anonymous methods, partial types and nullable types
15   anonymous methods, partial types and nullable types15   anonymous methods, partial types and nullable types
15 anonymous methods, partial types and nullable typesTuan Ngo
 
14 generics and iterators
14   generics and iterators14   generics and iterators
14 generics and iteratorsTuan Ngo
 
13 collections
13   collections13   collections
13 collectionsTuan Ngo
 
11 exception handling
11   exception handling11   exception handling
11 exception handlingTuan Ngo
 
12 events and delegates
12   events and delegates12   events and delegates
12 events and delegatesTuan Ngo
 
9 properties & indexers
9   properties & indexers9   properties & indexers
9 properties & indexersTuan Ngo
 
10 namespace
10  namespace10  namespace
10 namespaceTuan Ngo
 
8 abstract classes and interfaces
8   abstract classes and interfaces 8   abstract classes and interfaces
8 abstract classes and interfaces Tuan Ngo
 
3 statements and operators
3   statements and operators3   statements and operators
3 statements and operatorsTuan Ngo
 
4 c# programming constructs
4   c# programming constructs4   c# programming constructs
4 c# programming constructsTuan Ngo
 
1 get started with c#
1   get started with c#1   get started with c#
1 get started with c#Tuan Ngo
 
2 variables and data types
2   variables and data types2   variables and data types
2 variables and data typesTuan Ngo
 

Mehr von Tuan Ngo (20)

Introduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 enIntroduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 en
 
Net framework
Net frameworkNet framework
Net framework
 
15 anonymous methods, partial types and nullable types
15   anonymous methods, partial types and nullable types15   anonymous methods, partial types and nullable types
15 anonymous methods, partial types and nullable types
 
14 generics and iterators
14   generics and iterators14   generics and iterators
14 generics and iterators
 
13 collections
13   collections13   collections
13 collections
 
11 exception handling
11   exception handling11   exception handling
11 exception handling
 
12 events and delegates
12   events and delegates12   events and delegates
12 events and delegates
 
9 properties & indexers
9   properties & indexers9   properties & indexers
9 properties & indexers
 
10 namespace
10  namespace10  namespace
10 namespace
 
8 abstract classes and interfaces
8   abstract classes and interfaces 8   abstract classes and interfaces
8 abstract classes and interfaces
 
5 arrays
5   arrays5   arrays
5 arrays
 
3 statements and operators
3   statements and operators3   statements and operators
3 statements and operators
 
4 c# programming constructs
4   c# programming constructs4   c# programming constructs
4 c# programming constructs
 
1 get started with c#
1   get started with c#1   get started with c#
1 get started with c#
 
2 variables and data types
2   variables and data types2   variables and data types
2 variables and data types
 
Jdbc 7
Jdbc 7Jdbc 7
Jdbc 7
 
Jdbc 6
Jdbc 6Jdbc 6
Jdbc 6
 
Jdbc 3
Jdbc 3Jdbc 3
Jdbc 3
 
Jdbc 2
Jdbc 2Jdbc 2
Jdbc 2
 
Php
PhpPhp
Php
 

Kürzlich hochgeladen

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

6 class and methods

  • 1. Class and Method Programming in C# tnngo2@gmail.com
  • 3. Object-oriented programming Programming languages designed based on data and ways to manipulate data. Procedural Languages (Pascal, C) focus on ways Object-oriented Languages (C#, Java) focus on data
  • 4. Features Abstraction Encapsulation Inheritance Polymorphism Focus only the required information from objects
  • 5. Features Abstraction Encapsulation Inheritance Polymorphism Hide details of what a class contains
  • 6. Features Abstraction Encapsulation Inheritance Polymorphism Create a new class based on the attributes and methods of an existing class
  • 7. Features Abstraction Encapsulation Inheritance Polymorphism Behave differently in different situations
  • 9. Class – should & cannot Should be a noun first letter capitalized simple, descriptive, meaningful Cannot in mixed case C# keyword begin with a digit except @, _
  • 11. Method – can & cannot Can begin with a letter, _ or @ Cannot C# keyword contain space begin with digit
  • 12. Invoking methods https://gist.github.com/2349623
  • 13. Static methods called without creating any objects of the class refer only to static variables and other static methods of class. https://gist.github.com/2349658
  • 14. Static methods Only one copy of static variable is shared by all the objects of the class.
  • 15. Question? https://gist.github.com/2349708
  • 18. Ref causes arguments to be passed in a method by reference https://gist.github.com/2344456
  • 19. Out similar to ref but no required the variables that are passed by reference to be initialized https://gist.github.com/2344483
  • 21. Method overloading every method has a signature which comprises the number of params the data types of params the order of params
  • 22. Should and avoid Methods to be overloaded should perform the same task The signatures of the overloaded must be unique Return type is not a part of the signature The ref and out parameters can be included as a part of the signature
  • 23. This keyword refer to the current object of the class. cannot use this keyword with static variables and method https://gist.github.com/2344534
  • 24. Question? https://gist.github.com/2349708
  • 26. Constructors initialization no return type possible to have overloaded constructors https://gist.github.com/2344570
  • 27. Default Constructors C# creates a default constructors for a class if no constructor is specified within the class. It automatically initializes all the numeric data type instance variables to zero. If you define a constructor in the class, the default constructor is no longer used.
  • 28. Static Constructors initialize static variables of the class and to perform a particular action only once. is invoked before any static member of the class is accessed. does not take any parameters and does not use any access modifiers because it is invoked directly by the CLR instead of the object. Certainly, cannot access non-static data member. https://gist.github.com/2344643
  • 29. Constructor Overloading https://gist.github.com/2344673
  • 30. Destructors invoked automatically when the objects are not in use only one destructor in a class cannot be overloaded or inherited cannot be explicitly invoked cannot specify access modifiers and cannot take parameters https://gist.github.com/2344708