SlideShare uma empresa Scribd logo
1 de 57
CSE 136 Lecture 3 Part 1
   Introduction to C# language
   Memory Management
   Static vs non-static
   Properties
   Inheritance
   Modifiers (public, private, protected, etc)
   Namespace and Assembly (dll, exe)
Overview
C# Simple Program
C# keywords   Similar to Java
C# Pre-defined types
C# type values range
Stack Memory
Heap Memory
Value Type vs Reference Type
Value Types on Stack
Class Type
Class Type and Heap
Boxing
Unboxing




  Why box/unbox?
  Pass variables to method as reference
Value Parameter
Reference Parameter   box/unbox concept
Out Parameter
Static Field
Static Function Members
Const field vs Static field
Properties
Constructor




              Same method name
              Different param types
Static Constructor
Destructor
Inheritance - Concept




               Object re-use
Inheritance - Casting
Inheritance - virtual & override
Inheritance - Class Object
Constructor and inheritance
Modifier   Provide code security




                                   Assembly: Dll, Exe
                                   (Output of VS project)
Modifier and inheritance
Assembly and namespace
   Namespace is a collection of names wherein
    each name is unique
     ex: names CSE136.students
     ex: names CSE136.notes

   Assembly is an output unit (dll, exe).
     An  assembly can contain multiple namespaces
     ex: CSE136.dll
Review question
   How many bits is type int
   Does stack store type struct
   Where is type class data stored (stack or heap)?
   Where is static class data stored?
   Is string a value type?
   Difference between ref and out?
   Difference between static and const?
   Difference between public and protected?
   Difference between override and overload?
Break
CSE 136 - Lecture 3 Part 2
   Abstract Class
   Interfaces
   Generics
   Collections
   Enumeration
Abstract Class
Sealed
   The opposite of
    abstract class
   Instantiated as a
    stand-alone class
   Cannot derive from a
    sealed class
Interface 1
              Similar to abstract class
              without the method
              implementation
Interface 2
Interface 3 - Polymorphism
                        Multiple forms
                        (Method overriding)
Interface 4 - Polymorphism
                  Animal takes
                  on multiple forms



              ILiveBirth takes
              on multiple forms
Generics 1
Generics 2
Generic 3
Generic 4

Creating Variables and Instances

 Using a constructed type to create a reference and an instance
Generic 5
Two constructed classes created from a generic class
Generic 6
Collections 1
Using List to store string data
Collections 2

 List can also be used as a list of int
Collections 3
      Using Stack of string
Dictionary
Collections 4   - Another generic collection type
Enumeration 1   Iterator Pattern (Design Pattern)
Enumeration 2 - IEnumerator interface
Enumeration 3 - interface
Review question
   Difference between abstract class and
    interface?
   Difference between inheritance and
    polymorphism?
   What is type safe?
   Is generic type safe?
   Difference between enumerable and
    enumerator?
Your assignment
   Finish your DB design and stored procedures
    based on your UML diagram
   Demo to TA by Thursday end of class (25%
    late penalty will apply for late turn-ins)
References
   .NET : Architecting Applications for the
    Enterprise
   C# Illustrated

Mais conteúdo relacionado

Mais procurados

.NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know....NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know...Dan Douglas
 
Entity framework
Entity frameworkEntity framework
Entity frameworkicubesystem
 
Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...
Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...
Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...Simplilearn
 
Tcs Technical Question
Tcs Technical QuestionTcs Technical Question
Tcs Technical QuestionVinay Kumar
 
Three Software Architecture Styles
Three Software Architecture StylesThree Software Architecture Styles
Three Software Architecture StylesJorgen Thelin
 
Introducing Entity Framework 4.0
Introducing Entity Framework 4.0Introducing Entity Framework 4.0
Introducing Entity Framework 4.0Bishoy Demian
 
Domains - Don't leave your data model without them
Domains - Don't leave your data model without themDomains - Don't leave your data model without them
Domains - Don't leave your data model without themPeter Heller
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity FrameworkDoncho Minkov
 
Entity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic UnicornsEntity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic UnicornsRichie Rump
 
N-Tier, Layered Design, SOA
N-Tier, Layered Design, SOAN-Tier, Layered Design, SOA
N-Tier, Layered Design, SOASperasoft
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework OverviewEric Nelson
 
Entity Framework v2 Best Practices
Entity Framework v2 Best PracticesEntity Framework v2 Best Practices
Entity Framework v2 Best PracticesAndri Yadi
 
Introduction of Oracle
Introduction of Oracle Introduction of Oracle
Introduction of Oracle Salman Memon
 
Advanced Excel
Advanced Excel Advanced Excel
Advanced Excel eduCBA
 
Structural patterns
Structural patternsStructural patterns
Structural patternsHimanshu
 

Mais procurados (20)

.NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know....NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know...
 
L09 The Behavioral Problem
L09 The Behavioral ProblemL09 The Behavioral Problem
L09 The Behavioral Problem
 
Entity framework
Entity frameworkEntity framework
Entity framework
 
Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...
Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...
Top TCS Interview Questions And Answers | How to Crack An Interview At TCS | ...
 
L11 Application Architecture
L11 Application ArchitectureL11 Application Architecture
L11 Application Architecture
 
Tcs Technical Question
Tcs Technical QuestionTcs Technical Question
Tcs Technical Question
 
Three Software Architecture Styles
Three Software Architecture StylesThree Software Architecture Styles
Three Software Architecture Styles
 
Epsilon
EpsilonEpsilon
Epsilon
 
Introducing Entity Framework 4.0
Introducing Entity Framework 4.0Introducing Entity Framework 4.0
Introducing Entity Framework 4.0
 
Composite Design Pattern
Composite Design PatternComposite Design Pattern
Composite Design Pattern
 
Domains - Don't leave your data model without them
Domains - Don't leave your data model without themDomains - Don't leave your data model without them
Domains - Don't leave your data model without them
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity Framework
 
Composite pattern
Composite patternComposite pattern
Composite pattern
 
Entity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic UnicornsEntity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic Unicorns
 
N-Tier, Layered Design, SOA
N-Tier, Layered Design, SOAN-Tier, Layered Design, SOA
N-Tier, Layered Design, SOA
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
 
Entity Framework v2 Best Practices
Entity Framework v2 Best PracticesEntity Framework v2 Best Practices
Entity Framework v2 Best Practices
 
Introduction of Oracle
Introduction of Oracle Introduction of Oracle
Introduction of Oracle
 
Advanced Excel
Advanced Excel Advanced Excel
Advanced Excel
 
Structural patterns
Structural patternsStructural patterns
Structural patterns
 

Destaque

C# features I wish knew when I begun my career after University
C# features I wish knew when I begun my career after UniversityC# features I wish knew when I begun my career after University
C# features I wish knew when I begun my career after UniversityAntti Törrönen
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword pptVinod Kumar
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net frameworkArun Prasad
 

Destaque (6)

C# features I wish knew when I begun my career after University
C# features I wish knew when I begun my career after UniversityC# features I wish knew when I begun my career after University
C# features I wish knew when I begun my career after University
 
C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
 
C#.NET
C#.NETC#.NET
C#.NET
 
C# basics
 C# basics C# basics
C# basics
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 

Semelhante a Day3

Semelhante a Day3 (20)

Best C Sharp C# Training Online C# Online Course C# Online Training Best on...
Best C Sharp C# Training Online C# Online Course   C# Online Training Best on...Best C Sharp C# Training Online C# Online Course   C# Online Training Best on...
Best C Sharp C# Training Online C# Online Course C# Online Training Best on...
 
C# - Igor Ralić
C# - Igor RalićC# - Igor Ralić
C# - Igor Ralić
 
Core_Java_Interview.pdf
Core_Java_Interview.pdfCore_Java_Interview.pdf
Core_Java_Interview.pdf
 
Java quick reference
Java quick referenceJava quick reference
Java quick reference
 
OOPs - JAVA Quick Reference.pdf
OOPs - JAVA Quick Reference.pdfOOPs - JAVA Quick Reference.pdf
OOPs - JAVA Quick Reference.pdf
 
C#
C#C#
C#
 
CIS266 Midterm Review
CIS266 Midterm ReviewCIS266 Midterm Review
CIS266 Midterm Review
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
 
LectureNotes-02-DSA
LectureNotes-02-DSALectureNotes-02-DSA
LectureNotes-02-DSA
 
3rd june
3rd june3rd june
3rd june
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
 
C sharp
C sharpC sharp
C sharp
 
Data Structure Interview Questions & Answers
Data Structure Interview Questions & AnswersData Structure Interview Questions & Answers
Data Structure Interview Questions & Answers
 
C#ppt
C#pptC#ppt
C#ppt
 
C#, OOP introduction and examples
C#, OOP introduction and examplesC#, OOP introduction and examples
C#, OOP introduction and examples
 
ICOM4015 CIIC4010 Exam Review #1
ICOM4015 CIIC4010 Exam Review #1 ICOM4015 CIIC4010 Exam Review #1
ICOM4015 CIIC4010 Exam Review #1
 
Lecture 8 Library classes
Lecture 8 Library classesLecture 8 Library classes
Lecture 8 Library classes
 
Let's start with Java- Basic Concepts
Let's start with Java- Basic ConceptsLet's start with Java- Basic Concepts
Let's start with Java- Basic Concepts
 
OOPs Difference FAQs
OOPs Difference FAQsOOPs Difference FAQs
OOPs Difference FAQs
 
Introduction to Java Object Oiented Concepts and Basic terminologies
Introduction to Java Object Oiented Concepts and Basic terminologiesIntroduction to Java Object Oiented Concepts and Basic terminologies
Introduction to Java Object Oiented Concepts and Basic terminologies
 

Mais de madamewoolf (7)

Day8
Day8Day8
Day8
 
Day7
Day7Day7
Day7
 
Day6
Day6Day6
Day6
 
Day5
Day5Day5
Day5
 
Day4
Day4Day4
Day4
 
Day2
Day2Day2
Day2
 
Day1
Day1Day1
Day1
 

Último

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 

Último (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

Day3