SlideShare a Scribd company logo
1 of 6
C# class INTRODUCTION
What is C#?
โ€ข C# is a simple, modern, general-purpose, object-oriented programming language
โ€ข Reasons make C# a widely used professional language โ€“
โ€ข It is a modern, general-purpose programming language
โ€ข It is object oriented.
โ€ข It is component oriented.
โ€ข It is easy to learn.
โ€ข It is a structured language.
โ€ข It produces efficient programs.
โ€ข It can be compiled on a variety of computer platforms.
โ€ข It is a part of .NET Framework.
What is Namespace?
โ€ข A namespace is used to organize your code and is a collection of classes, interfaces, structs,
Enums and delegates.
โ€ข Namespace Declaration:
โ€ข The namespace declaration. using System, indicates that you are using The System namespace.
Example:
//Namespace Declaration
using System;
Purpose of Main method
โ€ข Main method is the entry point into your application.
//Namespace Declaration
using System;
namespace Introduction
{
class Program
{
static void Main(string[]args)
{
//C# Tutorial - Introduction
//Write toconsole
Console.WriteLine("Welcome toC#Training!");
Main1();
}
static void Main1()
{
Console.WriteLine("Welcome toC#Training 1!");
}
}
}
Reading and writing to a console
Reading from the console:
Example:
//Read the string from console
var username= Console.ReadLine();
//Read theint fromconsole
int userNumber= int.Parse(Console.ReadLine());
Writing to the console:
Example:
//Prompt the user for his name
Console.WriteLine("Please enteryour name");
2 ways to write to console:
Concatenation
Example:
//Concatenatenamewith hello word and print
Console.WriteLine("Hello "+ username);
Plate Holder syntax - Most Preferred
Example:
//Placeholder syntax to print namewith hello word -Most Preferred
Console.WriteLine("Hello {0}",username);
Console.WriteLine("Hello {0}{1}",firstname, lastname);

More Related Content

Similar to C# Class Introduction

LECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxLECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptx
AOmaAli
ย 
ASP.NET Session 3
ASP.NET Session 3ASP.NET Session 3
ASP.NET Session 3
Sisir Ghosh
ย 
Intro1
Intro1Intro1
Intro1
phanleson
ย 

Similar to C# Class Introduction (20)

Session#1 csharp MTCS
Session#1 csharp MTCSSession#1 csharp MTCS
Session#1 csharp MTCS
ย 
c# usage,applications and advantages
c# usage,applications and advantages c# usage,applications and advantages
c# usage,applications and advantages
ย 
C++ vs C#
C++ vs C#C++ vs C#
C++ vs C#
ย 
c vs java (2).pptx
c vs java (2).pptxc vs java (2).pptx
c vs java (2).pptx
ย 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
ย 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
ย 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
ย 
Understanding C and its Applications.pdf
Understanding C and its Applications.pdfUnderstanding C and its Applications.pdf
Understanding C and its Applications.pdf
ย 
Lecture 1
Lecture 1Lecture 1
Lecture 1
ย 
Compilers.pptx
Compilers.pptxCompilers.pptx
Compilers.pptx
ย 
Programming landuages
Programming landuagesProgramming landuages
Programming landuages
ย 
Structure of a C# Program
Structure of a C# ProgramStructure of a C# Program
Structure of a C# Program
ย 
Csharp introduction
Csharp introductionCsharp introduction
Csharp introduction
ย 
LECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxLECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptx
ย 
Why C is Called Structured Programming Language
Why C is Called Structured Programming LanguageWhy C is Called Structured Programming Language
Why C is Called Structured Programming Language
ย 
ASP.NET Session 3
ASP.NET Session 3ASP.NET Session 3
ASP.NET Session 3
ย 
C programming
C programmingC programming
C programming
ย 
Intro1
Intro1Intro1
Intro1
ย 
Programming in c
Programming in cProgramming in c
Programming in c
ย 
Programming in C
Programming in CProgramming in C
Programming in C
ย 

More from Arafat Bin Reza (8)

Inventory music shop management
Inventory music shop managementInventory music shop management
Inventory music shop management
ย 
C language 3
C language 3C language 3
C language 3
ย 
C language 2
C language 2C language 2
C language 2
ย 
C language updated
C language updatedC language updated
C language updated
ย 
C language
C languageC language
C language
ย 
Sudoku solve rmain
Sudoku solve rmainSudoku solve rmain
Sudoku solve rmain
ย 
string , pointer
string , pointerstring , pointer
string , pointer
ย 
final presentation of sudoku solver project
final presentation of sudoku solver projectfinal presentation of sudoku solver project
final presentation of sudoku solver project
ย 

Recently uploaded

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
ย 
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
ย 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
ย 
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night StandCall Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
amitlee9823
ย 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
sivaprakash250
ย 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
ย 

Recently uploaded (20)

Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
ย 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
ย 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
ย 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
ย 
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
ย 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
ย 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
ย 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
ย 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ย 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
ย 
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
ย 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
ย 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
ย 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
ย 
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night StandCall Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
ย 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ย 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
ย 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
ย 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
ย 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
ย 

C# Class Introduction

  • 2. What is C#? โ€ข C# is a simple, modern, general-purpose, object-oriented programming language โ€ข Reasons make C# a widely used professional language โ€“ โ€ข It is a modern, general-purpose programming language โ€ข It is object oriented. โ€ข It is component oriented. โ€ข It is easy to learn. โ€ข It is a structured language. โ€ข It produces efficient programs. โ€ข It can be compiled on a variety of computer platforms. โ€ข It is a part of .NET Framework.
  • 3. What is Namespace? โ€ข A namespace is used to organize your code and is a collection of classes, interfaces, structs, Enums and delegates. โ€ข Namespace Declaration: โ€ข The namespace declaration. using System, indicates that you are using The System namespace. Example: //Namespace Declaration using System;
  • 4. Purpose of Main method โ€ข Main method is the entry point into your application. //Namespace Declaration using System; namespace Introduction { class Program { static void Main(string[]args) { //C# Tutorial - Introduction //Write toconsole Console.WriteLine("Welcome toC#Training!"); Main1(); } static void Main1() { Console.WriteLine("Welcome toC#Training 1!"); } } }
  • 5. Reading and writing to a console Reading from the console: Example: //Read the string from console var username= Console.ReadLine(); //Read theint fromconsole int userNumber= int.Parse(Console.ReadLine()); Writing to the console: Example: //Prompt the user for his name Console.WriteLine("Please enteryour name");
  • 6. 2 ways to write to console: Concatenation Example: //Concatenatenamewith hello word and print Console.WriteLine("Hello "+ username); Plate Holder syntax - Most Preferred Example: //Placeholder syntax to print namewith hello word -Most Preferred Console.WriteLine("Hello {0}",username); Console.WriteLine("Hello {0}{1}",firstname, lastname);