SlideShare una empresa de Scribd logo
1 de 6
Descargar para leer sin conexión
The C# Language




                          Johan Franzén




C# – Overview

                Panel 1                   Panel 2

  Object Oriented (similar to Java)

  Appeared in 2001

  .NET Platform (VB.NET, J#, Managed C++ and more)

  Microsoft Windows

  Linux and Mac OS X with the mono project




                                                     1
C# – Common Language Infrastructure

               Panel 1         Panel 2




C# – Hello World

                               Panel 2

  using System;

  class Hello
  {
     static void Main() {
        Console.WriteLine(quot;Hello
        Console.WriteLine(quot;Hello worldquot;);
     }
  }




                                            2
C# – Data types

  int                                           Panel 2

  float
  string
  byte
  bool
  .
  .
  .

  float fValue = 2.0f;
  double dValue = 2.0;

  bool bValue = 5 (incorrect)




C# – Value Types and Reference Types

                       Panel 1                  Panel 2

  Value Types                                Value Type
                                             Point is a Struct
  By Value (copy)                            Point p1 = new Point();
                                             Point p2 = p1;
  int, float, … , Point, Vector2 (structs)
                                             (p2 is a copy of p1)
  Reference Types
  By Reference (reference)
                                             Reference Type
  Classes
                                             Person is a Class
                                             Person p1 = new Person();
                                                             Person();
                                             Person p2 = p1;

                                             (p2 points to the same
                                             object as p1)




                                                                         3
C# – Array & List

   Array (fixed size)

     int[]
     int[] myArray = new int[10];
                         int[10];

     myArray[2]
     myArray[2] = 3;




   List (can grow)

     List<int>
     List<int> myList = new List<int>();
                            List<int>();

     myList.Add(3);
     myList.Add(3);

     int myValue = myList[0];
                   myList[0];




C# – Iteration

   Standard for loop

      o
     for( t              y st Cou tt;
                        myList.Count;
     for(int i = 0; i < myList.Count; i++) {
                                         )
        Console.WriteLine(myList[
        Console.WriteLine(myList[i]);
     }



   foreach loop

     foreach(
     foreach(int value in myList) {
                          myList)
        Console.WriteLine( l )
        Console.WriteLine(value);
        C    l W it Li (value);
     }




                                               4
C# – get/set methods

   Java           Panel 1
   ------------------------------------------------
   class Person {
      private int age;

     public int getAge() { return age; }
                getAge()

     public void setAge(int value) {
                  setAge(
        if(age
        if(age >= 0)
           age = value;
     }
   }
   ------------------------------------------------
   Person p = new Person();
                  Person();
   p.setAge(20);
   p.setAge(20);
   int age = p.getAge();
             p.getAge();




C# – Properties

   C#             Panel 1           Panel 2
   ------------------------------------------------
   class Person {
      private int age;

     public int Age {
        get { return age; }
        set {
           if(age
           if(age >= 0)
              age = value;
                    value;
        }
     }
   }
   ------------------------------------------------
   Person p = new Person();
                  Person();
   p.Age = 20;
   int age = p.Age;
             p.Age;




                                                      5
ACTION




         6

Más contenido relacionado

La actualidad más candente

C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st StudyChris Ohk
 
[C++ Korea] Effective Modern C++ Study, Item 11 - 13
[C++ Korea] Effective Modern C++ Study, Item 11 - 13[C++ Korea] Effective Modern C++ Study, Item 11 - 13
[C++ Korea] Effective Modern C++ Study, Item 11 - 13Chris Ohk
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Aman Deep
 
C++ Programming - 11th Study
C++ Programming - 11th StudyC++ Programming - 11th Study
C++ Programming - 11th StudyChris Ohk
 
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...James Titcumb
 
Doublylinklist
DoublylinklistDoublylinklist
Doublylinklistritu1806
 
Short intro to the Rust language
Short intro to the Rust languageShort intro to the Rust language
Short intro to the Rust languageGines Espada
 
Writing a compiler in go
Writing a compiler in goWriting a compiler in go
Writing a compiler in goYusuke Kita
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQLvikram mahendra
 

La actualidad más candente (20)

Stl algorithm-Basic types
Stl algorithm-Basic typesStl algorithm-Basic types
Stl algorithm-Basic types
 
Implementing stack
Implementing stackImplementing stack
Implementing stack
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
 
Static and const members
Static and const membersStatic and const members
Static and const members
 
Codejunk Ignitesd
Codejunk IgnitesdCodejunk Ignitesd
Codejunk Ignitesd
 
informatics practices practical file
informatics practices practical fileinformatics practices practical file
informatics practices practical file
 
String Manipulation Function and Header File Functions
String Manipulation Function and Header File FunctionsString Manipulation Function and Header File Functions
String Manipulation Function and Header File Functions
 
C programs
C programsC programs
C programs
 
C Prog - Array
C Prog - ArrayC Prog - Array
C Prog - Array
 
[C++ Korea] Effective Modern C++ Study, Item 11 - 13
[C++ Korea] Effective Modern C++ Study, Item 11 - 13[C++ Korea] Effective Modern C++ Study, Item 11 - 13
[C++ Korea] Effective Modern C++ Study, Item 11 - 13
 
cosc 281 hw2
cosc 281 hw2cosc 281 hw2
cosc 281 hw2
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)
 
C++ Programming - 11th Study
C++ Programming - 11th StudyC++ Programming - 11th Study
C++ Programming - 11th Study
 
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
Mirror, mirror on the wall - Building a new PHP reflection library (Nomad PHP...
 
Doublylinklist
DoublylinklistDoublylinklist
Doublylinklist
 
Short intro to the Rust language
Short intro to the Rust languageShort intro to the Rust language
Short intro to the Rust language
 
Elf文件解析
Elf文件解析Elf文件解析
Elf文件解析
 
Writing a compiler in go
Writing a compiler in goWriting a compiler in go
Writing a compiler in go
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQL
 
week-20x
week-20xweek-20x
week-20x
 

Destacado

Rotation and Tessellation
Rotation and TessellationRotation and Tessellation
Rotation and TessellationJeanette Murphy
 
Stpm Pam Kertas2 Set2
Stpm Pam Kertas2 Set2Stpm Pam Kertas2 Set2
Stpm Pam Kertas2 Set2Kay Aniza
 
Skema Bm Kertas1 Set2
Skema Bm Kertas1 Set2Skema Bm Kertas1 Set2
Skema Bm Kertas1 Set2Kay Aniza
 
Meteor is Coming
Meteor is ComingMeteor is Coming
Meteor is ComingDaniel Teng
 
Advanced Blogging
Advanced BloggingAdvanced Blogging
Advanced Bloggingmythicgroup
 
Análisis exergético de sistemas industriales de aire comprimido
Análisis exergético de sistemas industriales de aire comprimidoAnálisis exergético de sistemas industriales de aire comprimido
Análisis exergético de sistemas industriales de aire comprimidoCarlos Alderetes
 
Smc073 11 april 2012 Vught
Smc073 11 april 2012 VughtSmc073 11 april 2012 Vught
Smc073 11 april 2012 VughtBart Brouwers
 
Management Final Project Fall 2008
Management Final Project Fall 2008Management Final Project Fall 2008
Management Final Project Fall 2008lat886
 
LambdaDay: Backbone.js
LambdaDay: Backbone.jsLambdaDay: Backbone.js
LambdaDay: Backbone.jsGiovanni Bassi
 
Zipmark product and market overview
Zipmark product and market overviewZipmark product and market overview
Zipmark product and market overviewJayastu Bhattacharya
 
E learners presentation 2010
E learners presentation 2010E learners presentation 2010
E learners presentation 2010Jeanette Murphy
 

Destacado (20)

Mobile Development
Mobile DevelopmentMobile Development
Mobile Development
 
Corei7
Corei7Corei7
Corei7
 
BDD no mundo real
BDD no mundo realBDD no mundo real
BDD no mundo real
 
Rotation and Tessellation
Rotation and TessellationRotation and Tessellation
Rotation and Tessellation
 
Stpm Pam Kertas2 Set2
Stpm Pam Kertas2 Set2Stpm Pam Kertas2 Set2
Stpm Pam Kertas2 Set2
 
Skema Bm Kertas1 Set2
Skema Bm Kertas1 Set2Skema Bm Kertas1 Set2
Skema Bm Kertas1 Set2
 
Meteor is Coming
Meteor is ComingMeteor is Coming
Meteor is Coming
 
Advanced Blogging
Advanced BloggingAdvanced Blogging
Advanced Blogging
 
Puertos De Comunicacion
Puertos De ComunicacionPuertos De Comunicacion
Puertos De Comunicacion
 
Análisis exergético de sistemas industriales de aire comprimido
Análisis exergético de sistemas industriales de aire comprimidoAnálisis exergético de sistemas industriales de aire comprimido
Análisis exergético de sistemas industriales de aire comprimido
 
Scavenger Hunt Collage
Scavenger Hunt CollageScavenger Hunt Collage
Scavenger Hunt Collage
 
Smc073 11 april 2012 Vught
Smc073 11 april 2012 VughtSmc073 11 april 2012 Vught
Smc073 11 april 2012 Vught
 
Moss Week 12 Final With Answers
Moss   Week 12   Final   With AnswersMoss   Week 12   Final   With Answers
Moss Week 12 Final With Answers
 
Wood
WoodWood
Wood
 
side_face samples
side_face samplesside_face samples
side_face samples
 
911 Jour 1
911  Jour 1911  Jour 1
911 Jour 1
 
Management Final Project Fall 2008
Management Final Project Fall 2008Management Final Project Fall 2008
Management Final Project Fall 2008
 
LambdaDay: Backbone.js
LambdaDay: Backbone.jsLambdaDay: Backbone.js
LambdaDay: Backbone.js
 
Zipmark product and market overview
Zipmark product and market overviewZipmark product and market overview
Zipmark product and market overview
 
E learners presentation 2010
E learners presentation 2010E learners presentation 2010
E learners presentation 2010
 

Similar a C Sharp Lecture Johan Franzen

Computer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperComputer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperDeepak Singh
 
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1Little Tukta Lita
 
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1Little Tukta Lita
 
Lecture 4: Data Types
Lecture 4: Data TypesLecture 4: Data Types
Lecture 4: Data TypesEelco Visser
 
C# Summer course - Lecture 2
C# Summer course - Lecture 2C# Summer course - Lecture 2
C# Summer course - Lecture 2mohamedsamyali
 
Dr archana dhawan bajaj - csharp fundamentals slides
Dr archana dhawan bajaj - csharp fundamentals slidesDr archana dhawan bajaj - csharp fundamentals slides
Dr archana dhawan bajaj - csharp fundamentals slidesDr-archana-dhawan-bajaj
 
Boost.Interfaces
Boost.InterfacesBoost.Interfaces
Boost.Interfacesmelpon
 
An Introduction to Part of C++ STL
An Introduction to Part of C++ STLAn Introduction to Part of C++ STL
An Introduction to Part of C++ STL乐群 陈
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple ProgramsUpender Upr
 
Lies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerLies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerGarth Gilmour
 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharpvoegtu
 

Similar a C Sharp Lecture Johan Franzen (20)

TechTalk - Dotnet
TechTalk - DotnetTechTalk - Dotnet
TechTalk - Dotnet
 
Computer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperComputer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paper
 
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
 
C++11
C++11C++11
C++11
 
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
 
Lezione03
Lezione03Lezione03
Lezione03
 
Lezione03
Lezione03Lezione03
Lezione03
 
Lecture 4: Data Types
Lecture 4: Data TypesLecture 4: Data Types
Lecture 4: Data Types
 
C#
C#C#
C#
 
C# Summer course - Lecture 2
C# Summer course - Lecture 2C# Summer course - Lecture 2
C# Summer course - Lecture 2
 
Python tour
Python tourPython tour
Python tour
 
Grammarware Memes
Grammarware MemesGrammarware Memes
Grammarware Memes
 
Why Learn Python?
Why Learn Python?Why Learn Python?
Why Learn Python?
 
Dr archana dhawan bajaj - csharp fundamentals slides
Dr archana dhawan bajaj - csharp fundamentals slidesDr archana dhawan bajaj - csharp fundamentals slides
Dr archana dhawan bajaj - csharp fundamentals slides
 
ASP.NET
ASP.NETASP.NET
ASP.NET
 
Boost.Interfaces
Boost.InterfacesBoost.Interfaces
Boost.Interfaces
 
An Introduction to Part of C++ STL
An Introduction to Part of C++ STLAn Introduction to Part of C++ STL
An Introduction to Part of C++ STL
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple Programs
 
Lies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerLies Told By The Kotlin Compiler
Lies Told By The Kotlin Compiler
 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharp
 

Último

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Último (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

C Sharp Lecture Johan Franzen

  • 1. The C# Language Johan Franzén C# – Overview Panel 1 Panel 2 Object Oriented (similar to Java) Appeared in 2001 .NET Platform (VB.NET, J#, Managed C++ and more) Microsoft Windows Linux and Mac OS X with the mono project 1
  • 2. C# – Common Language Infrastructure Panel 1 Panel 2 C# – Hello World Panel 2 using System; class Hello { static void Main() { Console.WriteLine(quot;Hello Console.WriteLine(quot;Hello worldquot;); } } 2
  • 3. C# – Data types int Panel 2 float string byte bool . . . float fValue = 2.0f; double dValue = 2.0; bool bValue = 5 (incorrect) C# – Value Types and Reference Types Panel 1 Panel 2 Value Types Value Type Point is a Struct By Value (copy) Point p1 = new Point(); Point p2 = p1; int, float, … , Point, Vector2 (structs) (p2 is a copy of p1) Reference Types By Reference (reference) Reference Type Classes Person is a Class Person p1 = new Person(); Person(); Person p2 = p1; (p2 points to the same object as p1) 3
  • 4. C# – Array & List Array (fixed size) int[] int[] myArray = new int[10]; int[10]; myArray[2] myArray[2] = 3; List (can grow) List<int> List<int> myList = new List<int>(); List<int>(); myList.Add(3); myList.Add(3); int myValue = myList[0]; myList[0]; C# – Iteration Standard for loop o for( t y st Cou tt; myList.Count; for(int i = 0; i < myList.Count; i++) { ) Console.WriteLine(myList[ Console.WriteLine(myList[i]); } foreach loop foreach( foreach(int value in myList) { myList) Console.WriteLine( l ) Console.WriteLine(value); C l W it Li (value); } 4
  • 5. C# – get/set methods Java Panel 1 ------------------------------------------------ class Person { private int age; public int getAge() { return age; } getAge() public void setAge(int value) { setAge( if(age if(age >= 0) age = value; } } ------------------------------------------------ Person p = new Person(); Person(); p.setAge(20); p.setAge(20); int age = p.getAge(); p.getAge(); C# – Properties C# Panel 1 Panel 2 ------------------------------------------------ class Person { private int age; public int Age { get { return age; } set { if(age if(age >= 0) age = value; value; } } } ------------------------------------------------ Person p = new Person(); Person(); p.Age = 20; int age = p.Age; p.Age; 5
  • 6. ACTION 6