SlideShare a Scribd company logo
1 of 28
C# Presentation
Trey Mack
James Moore
Osa Osar-Emokpae
C# Presentation, Spring 2003
Introduction
C#, pronounced “C Sharp,” is one of
the new languages in the .NET
framework being implemented by
Microsoft. All .NET languages
compile to a common byte code
(MSIL) making their integration into
programs written in different
languages easier.
C# Presentation, Spring 2003
History
 C
 C++
 Developed by Anders Hejlsberg
• Turbo Pascal
• Delphi
• Visual J++
 Released in 2001-2002
C# Presentation, Spring 2003
Previous Problems
 Memory Leaks
 Illegal Pointer References
 Overly Complex Multiple-Inheritance
 Static Linking
C# Presentation, Spring 2003
Resolutions
 Garbage Collection
 Threw out pointers
 Single inheritance with Interfaces
 Dynamic Linking
 Done 5 years ago in Java
C# Presentation, Spring 2003
What is C#
 Contrary to popular belief, C# is
not simply a clone of or
replacement for Java
 According to Anders Hejlsberg,
Microsoft’s Chief Architect, C# is a
derivation of C++, C, Java, Modula
2, and Smalltalk
C# Presentation, Spring 2003
What is C#
 C# combines the best features of
these languages and eradicates
some of their weaknesses
C# Presentation, Spring 2003
Why Choose C#?
 C# was designed from scratch with
the .net framework in mind
 C# combines the power of C and
C++ with the productivity of Visual
Basic
 With its familiar syntax the
transition for Java and C++
programmers will be an easy one
C# Presentation, Spring 2003
Why Choose C#?
C# is in sync with current web
standards and is easily integrated
with existing applications.
In today’s society where internet
programming is inevitable having a
language that already supports this
makes the job of the developer
easier.
C# Presentation, Spring 2003
Example of Code
The code looks a lot like Java
public class Example
{
public static void Main(string[] args)
{
foreach (string s in args)
{
System.Console.WriteLine(s);
}
}
}
C# Presentation, Spring 2003
Features
 OOP
C# Presentation, Spring 2003
OOP
C# is object oriented. Every class is a
subclass of an object. Everything is
an object, yes even primitives. This
makes generic programming easier.
Example:
int n = 3;
string s = n.ToString();
C# Presentation, Spring 2003
Features
 OOP
 Enumerators
C# Presentation, Spring 2003
Enumerators
Enumerators are a borrowed idea
from C/C++. This is a data type
consisting of a set of of named
integers.
Example:
enum Weekday {Mon, Tues, Wed, Thu,
Fri, Sat, Sun};
C# Presentation, Spring 2003
Features
 OOP
 Enumerators
 Operator Overloading
C# Presentation, Spring 2003
Operator Overloading
Operator Overloading is yet another
idea borrowed from c++. This
makes polymorphism easier with
custom data types.
Example:
Currency a, b, c;
c = a + b;
C# Presentation, Spring 2003
Features
 OOP
 Enumerators
 Operator Overloading
 Windows API Invocation
C# Presentation, Spring 2003
Windows API Invocation
C# was built with Windows in mind.
It was created to allow programmers
to create Windows application easily
through a wraparound API. Some
other technologies supported are
COM, COM+.
C# Presentation, Spring 2003
Features
 OOP
 Enumerators
 Operator Overloading
 Windows API Invocation
 Structured Error Handling
C# Presentation, Spring 2003
Structured Error Handling
C# introduces new error handling
techniques.
Try-catch blocks are used but with
more functionality.
To throw an object, it has to be a
subclass of System.Exception.
C# Presentation, Spring 2003
Try-Catch
try-catch blocks could be any of the following;
 try{ } catch(SomeException){ }
 try{ } catch(){ } //catches any kind of exception
 try{ } catch(){ } finally{ } //finally is always
executed
 try{ } finally{ } //finally is always executed
C# Presentation, Spring 2003
Features
 OOP
 Enumerators
 Operator Overloading
 Windows API Invocation
 Structured Error Handling
 Delegates
C# Presentation, Spring 2003
Delegates
Delegates provide a template for a
single method.
Example:
 public delegate int ArithOp(int a, int b);
 …
 public int DoOp(ArithOp ar)
 { return ar(a, b); }
C# Presentation, Spring 2003
Features
 OOP
 Enumerators
 Operator Overloading
 Windows API Invocation
 Structured Error Handling
 Delegates
 Namespaces
C# Presentation, Spring 2003
Namespace
Namespace is a method of organizing
similar files together. This is similar in
some way to the java package idea.
Every program is either explicitly within a
namespace or in by default.
Example:
 namespace Project{ public class P1{} }
 public class P2{}
C# Presentation, Spring 2003
Namespace
To use a namespace, you just simply import
by using the keyword using.
Example:
using system;
public class P1{}
C# Presentation, Spring 2003
Future of C#
With C#’s flexibility and support for
many languages through the .NET
architecture it will definitely become
a widely used language in all
aspects of programming.
C# Presentation, Spring 2003
Bibliography
 C# programming, Harvey, Robinson, Templeman,
Watson
 http://www.funducode.com/csharp/basics/basi
cs1.htm
 http://www.simonrobinson.com/DotNET/Article
s/Languages/IntroCSh.aspx
 http://windows.oreilly.com/news/hejlsberg_08
00.html
 http://msdn.microsoft.com/msdnmag/issues/0
900/csharp/default.aspx

More Related Content

What's hot (20)

Jsp/Servlet
Jsp/ServletJsp/Servlet
Jsp/Servlet
 
Model View Controller (MVC)
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 
ECMA Script
ECMA ScriptECMA Script
ECMA Script
 
Database programming
Database programmingDatabase programming
Database programming
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
C# String
C# StringC# String
C# String
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
C# Events
C# EventsC# Events
C# Events
 
Dot net assembly
Dot net assemblyDot net assembly
Dot net assembly
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
 
JAVA OOP
JAVA OOPJAVA OOP
JAVA OOP
 
Generics in java
Generics in javaGenerics in java
Generics in java
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_android
 

Similar to CSharp.ppt (20)

CSharp.ppt
CSharp.pptCSharp.ppt
CSharp.ppt
 
(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net
 
Srgoc dotnet_new
Srgoc dotnet_newSrgoc dotnet_new
Srgoc dotnet_new
 
Java introduction
Java introductionJava introduction
Java introduction
 
Introduction of c# day3
Introduction of c# day3Introduction of c# day3
Introduction of c# day3
 
.NET and C# introduction
.NET and C# introduction.NET and C# introduction
.NET and C# introduction
 
Core java part1
Core java  part1Core java  part1
Core java part1
 
C-sharping.docx
C-sharping.docxC-sharping.docx
C-sharping.docx
 
C# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkC# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net Framework
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
java vs C#
java vs C#java vs C#
java vs C#
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
introduction of c langauge(I unit)
introduction of c langauge(I unit)introduction of c langauge(I unit)
introduction of c langauge(I unit)
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
Objective c beginner's guide
Objective c beginner's guideObjective c beginner's guide
Objective c beginner's guide
 

More from ckthesolo

Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptxckthesolo
 
prefixesandsuffixesppt-150201201838-conversion-gate01.pdf
prefixesandsuffixesppt-150201201838-conversion-gate01.pdfprefixesandsuffixesppt-150201201838-conversion-gate01.pdf
prefixesandsuffixesppt-150201201838-conversion-gate01.pdfckthesolo
 
articles-180827134348.pptx
articles-180827134348.pptxarticles-180827134348.pptx
articles-180827134348.pptxckthesolo
 
BATTERIES m.pptx
BATTERIES m.pptxBATTERIES m.pptx
BATTERIES m.pptxckthesolo
 
INTELLIGENT RETRIVAL.pptx
INTELLIGENT RETRIVAL.pptxINTELLIGENT RETRIVAL.pptx
INTELLIGENT RETRIVAL.pptxckthesolo
 
BLUE EYE TECHNOLOGY.pptx
BLUE EYE TECHNOLOGY.pptxBLUE EYE TECHNOLOGY.pptx
BLUE EYE TECHNOLOGY.pptxckthesolo
 

More from ckthesolo (7)

Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptx
 
prefixesandsuffixesppt-150201201838-conversion-gate01.pdf
prefixesandsuffixesppt-150201201838-conversion-gate01.pdfprefixesandsuffixesppt-150201201838-conversion-gate01.pdf
prefixesandsuffixesppt-150201201838-conversion-gate01.pdf
 
articles-180827134348.pptx
articles-180827134348.pptxarticles-180827134348.pptx
articles-180827134348.pptx
 
BATTERIES m.pptx
BATTERIES m.pptxBATTERIES m.pptx
BATTERIES m.pptx
 
INTELLIGENT RETRIVAL.pptx
INTELLIGENT RETRIVAL.pptxINTELLIGENT RETRIVAL.pptx
INTELLIGENT RETRIVAL.pptx
 
Tg
TgTg
Tg
 
BLUE EYE TECHNOLOGY.pptx
BLUE EYE TECHNOLOGY.pptxBLUE EYE TECHNOLOGY.pptx
BLUE EYE TECHNOLOGY.pptx
 

Recently uploaded

Best VIP Call Girls Noida Sector 18 Call Me: 8448380779
Best VIP Call Girls Noida Sector 18 Call Me: 8448380779Best VIP Call Girls Noida Sector 18 Call Me: 8448380779
Best VIP Call Girls Noida Sector 18 Call Me: 8448380779Delhi Call girls
 
VVIP Pune Call Girls Katraj (7001035870) Pune Escorts Nearby with Complete Sa...
VVIP Pune Call Girls Katraj (7001035870) Pune Escorts Nearby with Complete Sa...VVIP Pune Call Girls Katraj (7001035870) Pune Escorts Nearby with Complete Sa...
VVIP Pune Call Girls Katraj (7001035870) Pune Escorts Nearby with Complete Sa...Call Girls in Nagpur High Profile
 
Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...
Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...
Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...ssifa0344
 
How Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of ReportingHow Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of ReportingAggregage
 
20240429 Calibre April 2024 Investor Presentation.pdf
20240429 Calibre April 2024 Investor Presentation.pdf20240429 Calibre April 2024 Investor Presentation.pdf
20240429 Calibre April 2024 Investor Presentation.pdfAdnet Communications
 
High Class Call Girls Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
High Class Call Girls Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsHigh Class Call Girls Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
High Class Call Girls Nagpur Grishma Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
The Economic History of the U.S. Lecture 19.pdf
The Economic History of the U.S. Lecture 19.pdfThe Economic History of the U.S. Lecture 19.pdf
The Economic History of the U.S. Lecture 19.pdfGale Pooley
 
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance CompanyInterimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance CompanyTyöeläkeyhtiö Elo
 
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...Henry Tapper
 
Lundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdfLundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdfAdnet Communications
 
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Booking open Available Pune Call Girls Shivane 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Shivane  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Shivane  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Shivane 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx
05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx
05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptxFinTech Belgium
 
VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Room
VIP Kolkata Call Girl Serampore 👉 8250192130  Available With RoomVIP Kolkata Call Girl Serampore 👉 8250192130  Available With Room
VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Roomdivyansh0kumar0
 
The Economic History of the U.S. Lecture 17.pdf
The Economic History of the U.S. Lecture 17.pdfThe Economic History of the U.S. Lecture 17.pdf
The Economic History of the U.S. Lecture 17.pdfGale Pooley
 
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130Suhani Kapoor
 
OAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptx
OAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptxOAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptx
OAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptxhiddenlevers
 
Andheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot ModelsAndheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot Modelshematsharma006
 

Recently uploaded (20)

Best VIP Call Girls Noida Sector 18 Call Me: 8448380779
Best VIP Call Girls Noida Sector 18 Call Me: 8448380779Best VIP Call Girls Noida Sector 18 Call Me: 8448380779
Best VIP Call Girls Noida Sector 18 Call Me: 8448380779
 
VVIP Pune Call Girls Katraj (7001035870) Pune Escorts Nearby with Complete Sa...
VVIP Pune Call Girls Katraj (7001035870) Pune Escorts Nearby with Complete Sa...VVIP Pune Call Girls Katraj (7001035870) Pune Escorts Nearby with Complete Sa...
VVIP Pune Call Girls Katraj (7001035870) Pune Escorts Nearby with Complete Sa...
 
Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...
Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...
Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...
 
Veritas Interim Report 1 January–31 March 2024
Veritas Interim Report 1 January–31 March 2024Veritas Interim Report 1 January–31 March 2024
Veritas Interim Report 1 January–31 March 2024
 
How Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of ReportingHow Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of Reporting
 
20240429 Calibre April 2024 Investor Presentation.pdf
20240429 Calibre April 2024 Investor Presentation.pdf20240429 Calibre April 2024 Investor Presentation.pdf
20240429 Calibre April 2024 Investor Presentation.pdf
 
High Class Call Girls Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
High Class Call Girls Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsHigh Class Call Girls Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
High Class Call Girls Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
The Economic History of the U.S. Lecture 19.pdf
The Economic History of the U.S. Lecture 19.pdfThe Economic History of the U.S. Lecture 19.pdf
The Economic History of the U.S. Lecture 19.pdf
 
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance CompanyInterimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
 
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
 
Lundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdfLundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdf
 
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
 
Booking open Available Pune Call Girls Shivane 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Shivane  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Shivane  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Shivane 6297143586 Call Hot Indian Gi...
 
05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx
05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx
05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx
 
VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Room
VIP Kolkata Call Girl Serampore 👉 8250192130  Available With RoomVIP Kolkata Call Girl Serampore 👉 8250192130  Available With Room
VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Room
 
The Economic History of the U.S. Lecture 17.pdf
The Economic History of the U.S. Lecture 17.pdfThe Economic History of the U.S. Lecture 17.pdf
The Economic History of the U.S. Lecture 17.pdf
 
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
 
OAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptx
OAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptxOAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptx
OAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptx
 
Commercial Bank Economic Capsule - April 2024
Commercial Bank Economic Capsule - April 2024Commercial Bank Economic Capsule - April 2024
Commercial Bank Economic Capsule - April 2024
 
Andheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot ModelsAndheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot Models
 

CSharp.ppt

  • 1. C# Presentation Trey Mack James Moore Osa Osar-Emokpae
  • 2. C# Presentation, Spring 2003 Introduction C#, pronounced “C Sharp,” is one of the new languages in the .NET framework being implemented by Microsoft. All .NET languages compile to a common byte code (MSIL) making their integration into programs written in different languages easier.
  • 3. C# Presentation, Spring 2003 History  C  C++  Developed by Anders Hejlsberg • Turbo Pascal • Delphi • Visual J++  Released in 2001-2002
  • 4. C# Presentation, Spring 2003 Previous Problems  Memory Leaks  Illegal Pointer References  Overly Complex Multiple-Inheritance  Static Linking
  • 5. C# Presentation, Spring 2003 Resolutions  Garbage Collection  Threw out pointers  Single inheritance with Interfaces  Dynamic Linking  Done 5 years ago in Java
  • 6. C# Presentation, Spring 2003 What is C#  Contrary to popular belief, C# is not simply a clone of or replacement for Java  According to Anders Hejlsberg, Microsoft’s Chief Architect, C# is a derivation of C++, C, Java, Modula 2, and Smalltalk
  • 7. C# Presentation, Spring 2003 What is C#  C# combines the best features of these languages and eradicates some of their weaknesses
  • 8. C# Presentation, Spring 2003 Why Choose C#?  C# was designed from scratch with the .net framework in mind  C# combines the power of C and C++ with the productivity of Visual Basic  With its familiar syntax the transition for Java and C++ programmers will be an easy one
  • 9. C# Presentation, Spring 2003 Why Choose C#? C# is in sync with current web standards and is easily integrated with existing applications. In today’s society where internet programming is inevitable having a language that already supports this makes the job of the developer easier.
  • 10. C# Presentation, Spring 2003 Example of Code The code looks a lot like Java public class Example { public static void Main(string[] args) { foreach (string s in args) { System.Console.WriteLine(s); } } }
  • 11. C# Presentation, Spring 2003 Features  OOP
  • 12. C# Presentation, Spring 2003 OOP C# is object oriented. Every class is a subclass of an object. Everything is an object, yes even primitives. This makes generic programming easier. Example: int n = 3; string s = n.ToString();
  • 13. C# Presentation, Spring 2003 Features  OOP  Enumerators
  • 14. C# Presentation, Spring 2003 Enumerators Enumerators are a borrowed idea from C/C++. This is a data type consisting of a set of of named integers. Example: enum Weekday {Mon, Tues, Wed, Thu, Fri, Sat, Sun};
  • 15. C# Presentation, Spring 2003 Features  OOP  Enumerators  Operator Overloading
  • 16. C# Presentation, Spring 2003 Operator Overloading Operator Overloading is yet another idea borrowed from c++. This makes polymorphism easier with custom data types. Example: Currency a, b, c; c = a + b;
  • 17. C# Presentation, Spring 2003 Features  OOP  Enumerators  Operator Overloading  Windows API Invocation
  • 18. C# Presentation, Spring 2003 Windows API Invocation C# was built with Windows in mind. It was created to allow programmers to create Windows application easily through a wraparound API. Some other technologies supported are COM, COM+.
  • 19. C# Presentation, Spring 2003 Features  OOP  Enumerators  Operator Overloading  Windows API Invocation  Structured Error Handling
  • 20. C# Presentation, Spring 2003 Structured Error Handling C# introduces new error handling techniques. Try-catch blocks are used but with more functionality. To throw an object, it has to be a subclass of System.Exception.
  • 21. C# Presentation, Spring 2003 Try-Catch try-catch blocks could be any of the following;  try{ } catch(SomeException){ }  try{ } catch(){ } //catches any kind of exception  try{ } catch(){ } finally{ } //finally is always executed  try{ } finally{ } //finally is always executed
  • 22. C# Presentation, Spring 2003 Features  OOP  Enumerators  Operator Overloading  Windows API Invocation  Structured Error Handling  Delegates
  • 23. C# Presentation, Spring 2003 Delegates Delegates provide a template for a single method. Example:  public delegate int ArithOp(int a, int b);  …  public int DoOp(ArithOp ar)  { return ar(a, b); }
  • 24. C# Presentation, Spring 2003 Features  OOP  Enumerators  Operator Overloading  Windows API Invocation  Structured Error Handling  Delegates  Namespaces
  • 25. C# Presentation, Spring 2003 Namespace Namespace is a method of organizing similar files together. This is similar in some way to the java package idea. Every program is either explicitly within a namespace or in by default. Example:  namespace Project{ public class P1{} }  public class P2{}
  • 26. C# Presentation, Spring 2003 Namespace To use a namespace, you just simply import by using the keyword using. Example: using system; public class P1{}
  • 27. C# Presentation, Spring 2003 Future of C# With C#’s flexibility and support for many languages through the .NET architecture it will definitely become a widely used language in all aspects of programming.
  • 28. C# Presentation, Spring 2003 Bibliography  C# programming, Harvey, Robinson, Templeman, Watson  http://www.funducode.com/csharp/basics/basi cs1.htm  http://www.simonrobinson.com/DotNET/Article s/Languages/IntroCSh.aspx  http://windows.oreilly.com/news/hejlsberg_08 00.html  http://msdn.microsoft.com/msdnmag/issues/0 900/csharp/default.aspx