SlideShare a Scribd company logo
1 of 13
OVERVIEW OF
What is C#?
 It is a computer-programming language developed by Microsoft
Corporation, USA.
 It is fully object-oriented language.
 Suitable for developing Web-based applications
 Designed for developing robust, reliable & durable components
to handle real-world applications.
Highlights of C#
 Derived from C/C++ family.
 It simplifies & modernizes C++.
 It is only component oriented language available today.
 It is a language designed for the .NET Framework.
 It is a concise, lean & modern language.
 It combines the best features of many commonly used languages: the
productivity of VB, the power of C++, & the elegance of Java.
 It is intrinsically object-oriented & web-enabled.
 It has a lean & consistent syntax.
 It is simple, robust & productive.
 Major parts of .NET Framework are actually coded in C#.
Why C# ?????
 The primary motivation while developing any language is the
concern that it able to handle the increasing complexity of programs
that are robust, durable & maintainable.
 The history of major languages developed is as follows:
BPCL B
C
C++
ANSI C
Oak
Java
ANSI C++
C#
1967 1970
1972
1983
1987
1991
1995
1996
2000
Dennis Ritchie
Bjarne Stroustrup
ANSI Committee
James Gostling
Sun MicroSystems
ANSI Committe
Microsoft
Martin Richards Ken Thompson
Continue….
 C & C++ languages suffer from a
number of shortcomings in
meeting World Wide Web
requirements & standards.
 Some are as follows:
1. The high complexity of language
2. They are not truly object oriented
3. They have poor type safety
4. They are not suitable for working
with new web technologies.
5. They do not support versioning
6. They are weak in consistency
7. Their poor compatibility with the
existing systems
 VB, a language promoted by
Microsoft for overcoming these
problems, is not truly object-
oriented and becomes
increasingly difficult to use when
systems become large.
 Java which is truly object-
oriented has not retained some
powerful C++ features such as
operator overloading.
 Java also lacks inter-operability
with code developed in other
languages.
 Microsoft therefore decided to
design a new language.
 The result is C#, a simple &
modern language that directly
addresses the needs of
component-based software
development.
 C# is a descendant of C++ which in turn is a
descendant of C as illustrated below:
C
C++
Java C# VB
Concept
ProductivityElegance
Concept
Component
Orientation
Object
Orentation
Power
Characteristics of C#
 Simple
 C# simplifies C++ by eliminating irksome operators such as ->,
::, and pointers.
 C# treats integers & Boolean data types as entirely different
types.
 Consistent
 C# supports an unified type system which eliminates the
problem of varying ranges of integer types.
 All types are treated as objects.
 Modern
 C# is called modern language because it supports:
 Automatic garbage collection
 Rich intrinsic model for error handling
 Decimal data types for financial applications
 Modern approach to debugging
 Robust security model
Continue….
 Object-Oriented
 C# is truly object-oriented. It supports:
 Encapsulation
 Inheritance
 Polymorphism
 Type-Safe
 Type safety promotes robust programs.
 C# incorporates number of type-safe measures:
 All dynamically allocated objects & arrays are initialized to
zero
 Use of any uninitialized variables produces an error message
by the compiler
 C# supports automatic garbage collection
 Version able
 Making new versions of software modules work with the
existing applications is known as versioning
 C# provides support for versioning with the help of new &
override keywords.
 Compatible
 C# enforces the .NET common
language specifications & therefore
allows inter-operation with other
.NET languages
 Interoperable
 C# provides support for using COM
objects, no matter what language
was used to author them.
 Flexible
 We may declare certain classes &
methods as ‘unsafe’ and then use
pointers to manipulate them.
Continue…
How Does C# differs from Java ?
1. C# has more primitive data types
2. Arrays are declared differently in C#
3. C# supports struct type & Java does not
4. Java does not provide for operator overloading
5. C# provides for better versioning support than Java
6. C# provides static constructors for initialization
7. Java does not directly support enumerations
8. C# uses is operator instead of instanceof operator in Java
9. C# checks overflows uses checked statements
10. There is no labeled break statement in C#. The goto statement is
used to achieve this.
11. In Java, the switch statement can have only integer expression,
while C# supports either an integer or string expressions
A Simple C# Program
class SampleOne
{
public static void Main()
{
System.Console.WriteLine(“C# is sharper than C++”);
}
}
 Executing the program
 Save the above file with SampleOne.cs name
 Compile as : csc SampleOne.cs
 C# compiler compiles your code and create an executable file by
name
 SampleOne.exe
 For executing the program, simply type in the name of the
executable file at the command prompt.
NAMESPACES
System.Console.WriteLine();
 Here System is a namespace in which the Console class is located.
 This class can be accessed using the dot operator.
 C# supports using directive that can be used to import the
namespace System into the program.
using System;
class SampleTwo
{
public static void Main()
{
Console.WriteLine(“Hello World!!!”);
}
}
Providing Interactive Input
using System;
class SampleEight
{
public static void Main(string[] args)
{
Console.Write(“Enter Your Name”);
string name = Console.ReadLine();
Console.WriteLine(“Hello ”+name);
}
}

More Related Content

What's hot (20)

C by balaguruswami - e.balagurusamy
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
 
Introduction to .NET Framework
Introduction to .NET FrameworkIntroduction to .NET Framework
Introduction to .NET Framework
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
C# Exceptions Handling
C# Exceptions Handling C# Exceptions Handling
C# Exceptions Handling
 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# Introduction
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
Asp net
Asp netAsp net
Asp net
 
C# basics
 C# basics C# basics
C# basics
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Oops concept on c#
Oops concept on c#Oops concept on c#
Oops concept on c#
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
Presentation on Core java
Presentation on Core javaPresentation on Core java
Presentation on Core java
 
C sharp
C sharpC sharp
C sharp
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
Programming in c#
Programming in c#Programming in c#
Programming in c#
 
Applets in java
Applets in javaApplets in java
Applets in java
 
Java
JavaJava
Java
 

Viewers also liked

Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
 
Functional Programming in C# and F#
Functional Programming in C# and F#Functional Programming in C# and F#
Functional Programming in C# and F#Alfonso Garcia-Caro
 
Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overviewagorolabs
 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial Jm Ramos
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointJavaTpoint.Com
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software TestingNishant Worah
 
Jira as a Tool for Test Management
Jira as a Tool for Test ManagementJira as a Tool for Test Management
Jira as a Tool for Test ManagementMaija Laksa
 
Using JIRA Software for Issue Tracking
Using JIRA Software for Issue TrackingUsing JIRA Software for Issue Tracking
Using JIRA Software for Issue TrackingAnjali Rao
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGAbhishek Dwivedi
 
Software Testing Basics
Software Testing BasicsSoftware Testing Basics
Software Testing BasicsBelal Raslan
 
C# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoringC# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoringEyob Lube
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programmingavikdhupar
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Beat Signer
 
Introduction To Jira
Introduction To JiraIntroduction To Jira
Introduction To JiraHua Soon Sim
 
Introduction to JIRA & Agile Project Management
Introduction to JIRA & Agile Project ManagementIntroduction to JIRA & Agile Project Management
Introduction to JIRA & Agile Project ManagementDan Chuparkoff
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing FundamentalsChankey Pathak
 

Viewers also liked (20)

Sql Overview
Sql OverviewSql Overview
Sql Overview
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Functional Programming in C# and F#
Functional Programming in C# and F#Functional Programming in C# and F#
Functional Programming in C# and F#
 
Introduction to Database SQL & PL/SQL
Introduction to Database SQL & PL/SQLIntroduction to Database SQL & PL/SQL
Introduction to Database SQL & PL/SQL
 
Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overview
 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
 
Dbms
DbmsDbms
Dbms
 
Jira as a Tool for Test Management
Jira as a Tool for Test ManagementJira as a Tool for Test Management
Jira as a Tool for Test Management
 
Using JIRA Software for Issue Tracking
Using JIRA Software for Issue TrackingUsing JIRA Software for Issue Tracking
Using JIRA Software for Issue Tracking
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
Software Testing Basics
Software Testing BasicsSoftware Testing Basics
Software Testing Basics
 
C# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoringC# coding standards, good programming principles & refactoring
C# coding standards, good programming principles & refactoring
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
 
Introduction To Jira
Introduction To JiraIntroduction To Jira
Introduction To Jira
 
Introduction to JIRA & Agile Project Management
Introduction to JIRA & Agile Project ManagementIntroduction to JIRA & Agile Project Management
Introduction to JIRA & Agile Project Management
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing Fundamentals
 

Similar to C# programming language

Similar to C# programming language (20)

Programming with c#
Programming with c#Programming with c#
Programming with c#
 
C# chap 1
C# chap 1C# chap 1
C# chap 1
 
C sharp chap1
C sharp chap1C sharp chap1
C sharp chap1
 
Event Driven Programming in C#.docx
Event Driven Programming in C#.docxEvent Driven Programming in C#.docx
Event Driven Programming in C#.docx
 
programming in c#.ppt
programming in c#.pptprogramming in c#.ppt
programming in c#.ppt
 
21UCAC61 C# and .Net Programming.pdf(MTNC)(BCA)
21UCAC61 C# and .Net Programming.pdf(MTNC)(BCA)21UCAC61 C# and .Net Programming.pdf(MTNC)(BCA)
21UCAC61 C# and .Net Programming.pdf(MTNC)(BCA)
 
Presentation1
Presentation1Presentation1
Presentation1
 
C# handout.docx
C# handout.docxC# handout.docx
C# handout.docx
 
C-sharping.docx
C-sharping.docxC-sharping.docx
C-sharping.docx
 
C#
C#C#
C#
 
C# vs Java What are The Differences.pdf
C# vs Java What are The Differences.pdfC# vs Java What are The Differences.pdf
C# vs Java What are The Differences.pdf
 
C#
C#C#
C#
 
DotNet Fundamentals
DotNet FundamentalsDotNet Fundamentals
DotNet Fundamentals
 
C#
C#C#
C#
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 
Migrating From Cpp To C Sharp
Migrating From Cpp To C SharpMigrating From Cpp To C Sharp
Migrating From Cpp To C Sharp
 
C#.ppt
C#.pptC#.ppt
C#.ppt
 
Advance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptxAdvance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptx
 
Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)
 
Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)
 

Recently uploaded

HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 

Recently uploaded (20)

HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 

C# programming language

  • 2. What is C#?  It is a computer-programming language developed by Microsoft Corporation, USA.  It is fully object-oriented language.  Suitable for developing Web-based applications  Designed for developing robust, reliable & durable components to handle real-world applications.
  • 3. Highlights of C#  Derived from C/C++ family.  It simplifies & modernizes C++.  It is only component oriented language available today.  It is a language designed for the .NET Framework.  It is a concise, lean & modern language.  It combines the best features of many commonly used languages: the productivity of VB, the power of C++, & the elegance of Java.  It is intrinsically object-oriented & web-enabled.  It has a lean & consistent syntax.  It is simple, robust & productive.  Major parts of .NET Framework are actually coded in C#.
  • 4. Why C# ?????  The primary motivation while developing any language is the concern that it able to handle the increasing complexity of programs that are robust, durable & maintainable.  The history of major languages developed is as follows: BPCL B C C++ ANSI C Oak Java ANSI C++ C# 1967 1970 1972 1983 1987 1991 1995 1996 2000 Dennis Ritchie Bjarne Stroustrup ANSI Committee James Gostling Sun MicroSystems ANSI Committe Microsoft Martin Richards Ken Thompson
  • 5. Continue….  C & C++ languages suffer from a number of shortcomings in meeting World Wide Web requirements & standards.  Some are as follows: 1. The high complexity of language 2. They are not truly object oriented 3. They have poor type safety 4. They are not suitable for working with new web technologies. 5. They do not support versioning 6. They are weak in consistency 7. Their poor compatibility with the existing systems  VB, a language promoted by Microsoft for overcoming these problems, is not truly object- oriented and becomes increasingly difficult to use when systems become large.  Java which is truly object- oriented has not retained some powerful C++ features such as operator overloading.  Java also lacks inter-operability with code developed in other languages.  Microsoft therefore decided to design a new language.  The result is C#, a simple & modern language that directly addresses the needs of component-based software development.
  • 6.  C# is a descendant of C++ which in turn is a descendant of C as illustrated below: C C++ Java C# VB Concept ProductivityElegance Concept Component Orientation Object Orentation Power
  • 7. Characteristics of C#  Simple  C# simplifies C++ by eliminating irksome operators such as ->, ::, and pointers.  C# treats integers & Boolean data types as entirely different types.  Consistent  C# supports an unified type system which eliminates the problem of varying ranges of integer types.  All types are treated as objects.  Modern  C# is called modern language because it supports:  Automatic garbage collection  Rich intrinsic model for error handling  Decimal data types for financial applications  Modern approach to debugging  Robust security model
  • 8. Continue….  Object-Oriented  C# is truly object-oriented. It supports:  Encapsulation  Inheritance  Polymorphism  Type-Safe  Type safety promotes robust programs.  C# incorporates number of type-safe measures:  All dynamically allocated objects & arrays are initialized to zero  Use of any uninitialized variables produces an error message by the compiler  C# supports automatic garbage collection  Version able  Making new versions of software modules work with the existing applications is known as versioning  C# provides support for versioning with the help of new & override keywords.
  • 9.  Compatible  C# enforces the .NET common language specifications & therefore allows inter-operation with other .NET languages  Interoperable  C# provides support for using COM objects, no matter what language was used to author them.  Flexible  We may declare certain classes & methods as ‘unsafe’ and then use pointers to manipulate them. Continue…
  • 10. How Does C# differs from Java ? 1. C# has more primitive data types 2. Arrays are declared differently in C# 3. C# supports struct type & Java does not 4. Java does not provide for operator overloading 5. C# provides for better versioning support than Java 6. C# provides static constructors for initialization 7. Java does not directly support enumerations 8. C# uses is operator instead of instanceof operator in Java 9. C# checks overflows uses checked statements 10. There is no labeled break statement in C#. The goto statement is used to achieve this. 11. In Java, the switch statement can have only integer expression, while C# supports either an integer or string expressions
  • 11. A Simple C# Program class SampleOne { public static void Main() { System.Console.WriteLine(“C# is sharper than C++”); } }  Executing the program  Save the above file with SampleOne.cs name  Compile as : csc SampleOne.cs  C# compiler compiles your code and create an executable file by name  SampleOne.exe  For executing the program, simply type in the name of the executable file at the command prompt.
  • 12. NAMESPACES System.Console.WriteLine();  Here System is a namespace in which the Console class is located.  This class can be accessed using the dot operator.  C# supports using directive that can be used to import the namespace System into the program. using System; class SampleTwo { public static void Main() { Console.WriteLine(“Hello World!!!”); } }
  • 13. Providing Interactive Input using System; class SampleEight { public static void Main(string[] args) { Console.Write(“Enter Your Name”); string name = Console.ReadLine(); Console.WriteLine(“Hello ”+name); } }