SlideShare a Scribd company logo
1 of 36
C# language
Session -3
Objectives
1.Understanding of the language basics to facilitate
development.
2.Basic Object Oriented Programming concepts and
C# Programming Structure.
3. Language fundamentals
4.Doing our first C# Program.
5. Hands on knowledge in Visual Studio.
Introduction
• C# (pronounced “See Sharp”) is a simple, modern,
object-oriented programming language.
• It was made by Microsoft Corporation, more
precisely by Anders Hejlsberg.
• It was created to use all capacities of .NET
platform. The first version appeared in 2001, last
update appeared in 2010 with the C# 4.0.
• C# has its roots in the C family of languages and
will be immediately familiar to C, C++, and Java
programmers.
Fundamentals of Object Oriented
Programming
• OOPs design methodology is different from
traditional language like BASIC, Pascal, C etc.
Those are called the Procedural Language.
• In OOP, the emphasis is on Data and not on
procedures.
Class
• In OOP, A class describes all the attributes of
objects,as well as the methods that implement the
behavior of member object.
• A class is only a specification of a data type.
• A class is like a blue print of the Object.
Fundamentals of Object Oriented
Programming(Contd..)
Objects
• They are instance of classes.
• Objects are the central idea behind OOP
technology.
• An object is a bundle of variables and related
methods.
• When an object is created memory allocation
takes place.
Fundamentals of Object Oriented
Programming(Contd..)
Three principles of object oriented programming
1.Encapsulation
• The ability to hide the internals details of an object
from the outside world.
2.Inheritance
• Hierarchy is used to define more specialized classes
based on a preexisting generalized class.
3.Polymorphism
• The ability to extend functionality.
Abstract Class:
 We can not create a object of abstract class.
 It only allows other classes to inherit from it but can't
be instantiated.
 In C# we use Abstract Keyword.
Interface
 An interface is not a class, is entity.
 An interface has no implementation; it only has the
signature.
 Just the definition of the methods without the body.
Partial Class Example
• public partial class MyClass
• {
• partial void DoSomethingElse();
• public void DoSomething()
• {
Console.WriteLine("DoSomething() execution
started.");
• DoSomethingElse();
• Console.WriteLine("DoSomething() execution
finished.");
• Console.ReadKey();
• }
• }
• public partial class MyClass
• {
• partial void DoSomethingElse()
• {
• Console.WriteLine("DoSomethingElse()
called.");
• }
• }
• class Program
• {
•
• static void Main(string[] args)
• {
• MyClass mm = new MyClass();
• mm.DoSomething();
• }
• }
• }
OutPut
• DoSomething() execution started.
• DoSomethingElse() called.
• DoSomething() execution finished.
C# Language Fundamentals
• Garbage collection automatically reclaims
memory occupied by unused objects.
• Exception handling provides a structured and
extensible approach to error detection and
recovery.
• Ex: try, catch & finally
• C# is case-sensitive.
C# Console Application
• Console applications in C# have exactly the same purpose
as regular console applications: to provide a command line
interface with the user.
• Console applications have three main input streams:
standard in, standard out and standard error.
• “Hello World” Program using C#:
using System;
class Hello
{
static void Main(String[] args)
{
Console.WriteLine("Hello, World");
}
}
C# Console Application in Visual
Studio
C# Console Application(Contd..)
• The "System.Console" class:- The main element
in a console application is the "System.Console"
class. It contains all methods needed to control the
three streams of data.
• "ReadLine" method:- The main ways of
acquiring data from the standard input stream.
"ReadLine" reads a whole line of characters from
the buffer up to the point where the first end line
character ("n") is found. It outputs its data as
"string“.
Working with Visual Studio
• Microsoft Visual Studio is an Integrated Development
Environment (IDE) from Microsoft.
• It can be used to develop Console applications along
with Windows Forms applications, web sites, web
applications, and web services.
• Features :
1. Code editor
2. Debugger
3. Designer
4. Other Tools
Code editor
• Visual Studio includes a code editor that
supports syntax highlighting and code
completion using IntelliSense for not only
variables, functions and methods but also
language constructs like loops and queries.
• Autocomplete suggestions are popped up in a
modeless list box, overlaid on top of the code
editor.
Debugger
• Visual Studio includes a debugger that works both as a
source-level debugger and as a machine-level debugger.
• It works with both managed code as well as native code and
can be used for debugging applications written in any
language supported by Visual Studio.
• The debugger allows setting breakpoints (which allow
execution to be stopped temporarily at a certain position).
• The debugger supports Edit and Continue, i.e., it allows
code to be edited as it is being debugged (32 bit only; not
supported in 64 bit).
• When debugging, if the mouse pointer hovers over any
variable, its current value is displayed in a tooltip ("data
tooltips"), where it can also be modified if desired.
Designer
• Visual Studio includes a host of visual
designers to aid in the development of
applications. These tools include:
1. Windows Forms Designer
2. Web designer/development
3. Class designer
4. Data designer
Windows Forms Designer
• The Windows Forms designer is used to build GUI
applications using Windows Forms.
• It includes a palette of UI widgets and controls (including
buttons, progress bars, labels, layout containers and other
controls) that can be dragged and dropped on a form
surface.
• Layout can be controlled by housing the controls inside
other containers or locking them to the side of the form.
• Controls that display data (like textbox, list box, grid view,
etc.) can be data-bound to data sources like databases or
queries.
• The designer generates either C# or VB.NET code for the
application.
Web designer/development
• Visual Studio also includes a web-site editor
and designer that allows web pages to be
authored by dragging and dropping Web
controls.
• It is used for developing ASP.NET
applications and supports HTML, CSS and
JavaScript.
• It uses a code-behind model to link with
ASP.NET code.
Class designer
• The Class Designer is used to author and edit
the classes.
• The Class Designer can generate C# and
VB.NET code outlines for the classes and
methods.
• It can also generate class diagrams from hand-
written classes.
Data designer
• The data designer can be used to graphically
edit typed database tables, primary and foreign
keys and constraints.
• It can also be used to design queries from the
graphical view.
Polymorphism in .Net
• What is Polymorphism?
Polymorphism means same operation may
behave differently on different classes.
Example of Compile Time Polymorphism:
Method Overloading
Example of Run Time Polymorphism: Method
Overriding
Example of Compile Time
Polymorphism
Method Overloading
- Method with same name but with different arguments is
called method overloading.
- Method Overloading forms compile-time polymorphism.
- Example of Method Overloading:
class A1
{
void hello()
{ Console.WriteLine(“Hello”); }
void hello(string s)
{ Console.WriteLine(“Hello {0}”,s); }
}
Run Time Polymorphism
• Method Overriding
- Method overriding occurs when child class declares
a method that has the same type arguments as a
method declared by one of its superclass.
- Method overriding forms Run-time polymorphism.
- Note: By default functions are not virtual in C# and
so you need to write “virtual” explicitly. While by
default in Java each function are virtual.
- Example of Method Overriding:
• Class parent
{
virtual void hello()
{ Console.WriteLine(“Hello from Parent”); }
}
Class child : parent
{
override void hello()
{ Console.WriteLine(“Hello from Child”); }
}
static void main()
{
parent objParent = new child();
objParent.hello();
}
//Output
Hello from Child.
•
Summery
Language basics to facilitate development.
Basic Object Oriented Programming concepts
C# Programming Structure.
Language fundamentals
Doing our first C# Program.
Hands on knowledge in Visual Studio.

More Related Content

What's hot

Introduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayambaIntroduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayambaPrageeth Sandakalum
 
.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligetiNaveen Kumar Veligeti
 
Architecture in .net
Architecture in .netArchitecture in .net
Architecture in .netLarry Nung
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.netJaya Kumari
 
.Net framework architecture
.Net framework architecture.Net framework architecture
.Net framework architectureFad Zulkifli
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NETsalonityagi
 
Architecture of .net framework
Architecture of .net frameworkArchitecture of .net framework
Architecture of .net frameworkThen Murugeshwari
 
Dotnet Frameworks Version History
Dotnet Frameworks Version HistoryDotnet Frameworks Version History
Dotnet Frameworks Version Historyvoltaincx
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net frameworkArun Prasad
 
VB.NET:An introduction to Namespaces in .NET framework
VB.NET:An introduction to  Namespaces in .NET frameworkVB.NET:An introduction to  Namespaces in .NET framework
VB.NET:An introduction to Namespaces in .NET frameworkRicha Handa
 
.Net introduction
.Net introduction.Net introduction
.Net introductionSireesh K
 
dot net technology
dot net technologydot net technology
dot net technologyImran Khan
 
The .NET Platform - A Brief Overview
The .NET Platform - A Brief OverviewThe .NET Platform - A Brief Overview
The .NET Platform - A Brief OverviewCarlos Lopes
 
Module 1: Introduction to .NET Framework 3.5 (Slides)
Module 1: Introduction to .NET Framework 3.5 (Slides)Module 1: Introduction to .NET Framework 3.5 (Slides)
Module 1: Introduction to .NET Framework 3.5 (Slides)Mohamed Saleh
 
ASP.NET 01 - Introduction
ASP.NET 01 - IntroductionASP.NET 01 - Introduction
ASP.NET 01 - IntroductionRandy Connolly
 

What's hot (20)

Introduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayambaIntroduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayamba
 
C sharp
C sharpC sharp
C sharp
 
.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti
 
Architecture in .net
Architecture in .netArchitecture in .net
Architecture in .net
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.net
 
.Net framework architecture
.Net framework architecture.Net framework architecture
.Net framework architecture
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NET
 
Architecture of .net framework
Architecture of .net frameworkArchitecture of .net framework
Architecture of .net framework
 
Dotnet Frameworks Version History
Dotnet Frameworks Version HistoryDotnet Frameworks Version History
Dotnet Frameworks Version History
 
C#.NET
C#.NETC#.NET
C#.NET
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
VB.NET:An introduction to Namespaces in .NET framework
VB.NET:An introduction to  Namespaces in .NET frameworkVB.NET:An introduction to  Namespaces in .NET framework
VB.NET:An introduction to Namespaces in .NET framework
 
.Net introduction
.Net introduction.Net introduction
.Net introduction
 
dot net technology
dot net technologydot net technology
dot net technology
 
The .NET Platform - A Brief Overview
The .NET Platform - A Brief OverviewThe .NET Platform - A Brief Overview
The .NET Platform - A Brief Overview
 
C Sharp Course 101.5
C Sharp Course 101.5C Sharp Course 101.5
C Sharp Course 101.5
 
1.Philosophy of .NET
1.Philosophy of .NET1.Philosophy of .NET
1.Philosophy of .NET
 
Module 1: Introduction to .NET Framework 3.5 (Slides)
Module 1: Introduction to .NET Framework 3.5 (Slides)Module 1: Introduction to .NET Framework 3.5 (Slides)
Module 1: Introduction to .NET Framework 3.5 (Slides)
 
ASP.NET 01 - Introduction
ASP.NET 01 - IntroductionASP.NET 01 - Introduction
ASP.NET 01 - Introduction
 
Working in Visual Studio.Net
Working in Visual Studio.NetWorking in Visual Studio.Net
Working in Visual Studio.Net
 

Viewers also liked

Chapter ii c#(building a user interface)
Chapter ii c#(building a user interface)Chapter ii c#(building a user interface)
Chapter ii c#(building a user interface)Chhom Karath
 
android sqlite
android sqliteandroid sqlite
android sqliteDeepa Rani
 
SQLite: Light, Open Source Relational Database Management System
SQLite: Light, Open Source Relational Database Management SystemSQLite: Light, Open Source Relational Database Management System
SQLite: Light, Open Source Relational Database Management SystemTanner Jessel
 
How to create rss feed
How to create rss feedHow to create rss feed
How to create rss feedTanuja Talekar
 
how to setup Google analytics tracking code for website
how to setup  Google analytics tracking code for websitehow to setup  Google analytics tracking code for website
how to setup Google analytics tracking code for websiteOM Maurya
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notesWE-IT TUTORIALS
 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial Jm Ramos
 

Viewers also liked (16)

Chapter ii c#(building a user interface)
Chapter ii c#(building a user interface)Chapter ii c#(building a user interface)
Chapter ii c#(building a user interface)
 
Vara Framework
Vara FrameworkVara Framework
Vara Framework
 
04 gui 05
04 gui 0504 gui 05
04 gui 05
 
Chapter 14
Chapter 14Chapter 14
Chapter 14
 
Introducation to C#
Introducation to C#Introducation to C#
Introducation to C#
 
Sdi & mdi
Sdi & mdiSdi & mdi
Sdi & mdi
 
Sqlite
SqliteSqlite
Sqlite
 
android sqlite
android sqliteandroid sqlite
android sqlite
 
SQLite: Light, Open Source Relational Database Management System
SQLite: Light, Open Source Relational Database Management SystemSQLite: Light, Open Source Relational Database Management System
SQLite: Light, Open Source Relational Database Management System
 
SQLite - Overview
SQLite - OverviewSQLite - Overview
SQLite - Overview
 
How to create rss feed
How to create rss feedHow to create rss feed
How to create rss feed
 
how to setup Google analytics tracking code for website
how to setup  Google analytics tracking code for websitehow to setup  Google analytics tracking code for website
how to setup Google analytics tracking code for website
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
 
C#/.NET Little Wonders
C#/.NET Little WondersC#/.NET Little Wonders
C#/.NET Little Wonders
 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial
 
Programming in c#
Programming in c#Programming in c#
Programming in c#
 

Similar to ASP.NET Session 3

introduction to c #
introduction to c #introduction to c #
introduction to c #Sireesh K
 
CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)Dilawar Khan
 
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 FrameworkDr.Neeraj Kumar Pandey
 
Introducing object oriented programming (oop)
Introducing object oriented programming (oop)Introducing object oriented programming (oop)
Introducing object oriented programming (oop)Hemlathadhevi Annadhurai
 
Csc153 chapter 01
Csc153 chapter 01Csc153 chapter 01
Csc153 chapter 01PCC
 
Building iOS App Project & Architecture
Building iOS App Project & ArchitectureBuilding iOS App Project & Architecture
Building iOS App Project & ArchitectureMassimo Oliviero
 
Intro to Microsoft.NET
Intro to Microsoft.NET Intro to Microsoft.NET
Intro to Microsoft.NET rchakra
 
Cs690 object oriented_software_engineering_team01_ report
Cs690 object oriented_software_engineering_team01_ reportCs690 object oriented_software_engineering_team01_ report
Cs690 object oriented_software_engineering_team01_ reportKhushboo Wadhwani
 
Computer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptxComputer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptxfatahozil
 
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)ssuser7f90ae
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxshashiden1
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroMohammad Shaker
 
c# usage,applications and advantages
c# usage,applications and advantages c# usage,applications and advantages
c# usage,applications and advantages mohamed drahem
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfAnassElHousni
 
01. introduction to-programming
01. introduction to-programming01. introduction to-programming
01. introduction to-programmingStoian Kirov
 

Similar to ASP.NET Session 3 (20)

introduction to c #
introduction to c #introduction to c #
introduction to c #
 
Intro to .NET and Core C#
Intro to .NET and Core C#Intro to .NET and Core C#
Intro to .NET and Core C#
 
CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)
 
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
 
Introducing object oriented programming (oop)
Introducing object oriented programming (oop)Introducing object oriented programming (oop)
Introducing object oriented programming (oop)
 
Csc153 chapter 01
Csc153 chapter 01Csc153 chapter 01
Csc153 chapter 01
 
Building iOS App Project & Architecture
Building iOS App Project & ArchitectureBuilding iOS App Project & Architecture
Building iOS App Project & Architecture
 
Intro to Microsoft.NET
Intro to Microsoft.NET Intro to Microsoft.NET
Intro to Microsoft.NET
 
Cs690 object oriented_software_engineering_team01_ report
Cs690 object oriented_software_engineering_team01_ reportCs690 object oriented_software_engineering_team01_ report
Cs690 object oriented_software_engineering_team01_ report
 
C# Fundamental
C# FundamentalC# Fundamental
C# Fundamental
 
C++ l 1
C++ l 1C++ l 1
C++ l 1
 
Computer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptxComputer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptx
 
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)
 
C_Programming_Notes_ICE
C_Programming_Notes_ICEC_Programming_Notes_ICE
C_Programming_Notes_ICE
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptx
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - Intro
 
c# usage,applications and advantages
c# usage,applications and advantages c# usage,applications and advantages
c# usage,applications and advantages
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
 
iOS Application Exploitation
iOS Application ExploitationiOS Application Exploitation
iOS Application Exploitation
 
01. introduction to-programming
01. introduction to-programming01. introduction to-programming
01. introduction to-programming
 

More from Sisir Ghosh

ASP.NET Session 5
ASP.NET Session 5ASP.NET Session 5
ASP.NET Session 5Sisir Ghosh
 
ASP.NET Session 6
ASP.NET Session 6ASP.NET Session 6
ASP.NET Session 6Sisir Ghosh
 
ASP.NET Session 7
ASP.NET Session 7ASP.NET Session 7
ASP.NET Session 7Sisir Ghosh
 
ASP.NET Session 8
ASP.NET Session 8ASP.NET Session 8
ASP.NET Session 8Sisir Ghosh
 
ASP.NET Session 9
ASP.NET Session 9ASP.NET Session 9
ASP.NET Session 9Sisir Ghosh
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10Sisir Ghosh
 
ASP.NET Session 11 12
ASP.NET Session 11 12ASP.NET Session 11 12
ASP.NET Session 11 12Sisir Ghosh
 
ASP.NET Session 13 14
ASP.NET Session 13 14ASP.NET Session 13 14
ASP.NET Session 13 14Sisir Ghosh
 
ASP.NET Session 16
ASP.NET Session 16ASP.NET Session 16
ASP.NET Session 16Sisir Ghosh
 
ASP.NET System design 2
ASP.NET System design 2ASP.NET System design 2
ASP.NET System design 2Sisir Ghosh
 
ASP.NET Session 1
ASP.NET Session 1ASP.NET Session 1
ASP.NET Session 1Sisir Ghosh
 
Network security
Network securityNetwork security
Network securitySisir Ghosh
 
Module ii physical layer
Module ii physical layerModule ii physical layer
Module ii physical layerSisir Ghosh
 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correctionSisir Ghosh
 
Overview of data communication and networking
Overview of data communication and networkingOverview of data communication and networking
Overview of data communication and networkingSisir Ghosh
 
Application layer
Application layerApplication layer
Application layerSisir Ghosh
 

More from Sisir Ghosh (18)

ASP.NET Session 5
ASP.NET Session 5ASP.NET Session 5
ASP.NET Session 5
 
ASP.NET Session 6
ASP.NET Session 6ASP.NET Session 6
ASP.NET Session 6
 
ASP.NET Session 7
ASP.NET Session 7ASP.NET Session 7
ASP.NET Session 7
 
ASP.NET Session 8
ASP.NET Session 8ASP.NET Session 8
ASP.NET Session 8
 
ASP.NET Session 9
ASP.NET Session 9ASP.NET Session 9
ASP.NET Session 9
 
ASP.NET Session 10
ASP.NET Session 10ASP.NET Session 10
ASP.NET Session 10
 
ASP.NET Session 11 12
ASP.NET Session 11 12ASP.NET Session 11 12
ASP.NET Session 11 12
 
ASP.NET Session 13 14
ASP.NET Session 13 14ASP.NET Session 13 14
ASP.NET Session 13 14
 
ASP.NET Session 16
ASP.NET Session 16ASP.NET Session 16
ASP.NET Session 16
 
ASP.NET System design 2
ASP.NET System design 2ASP.NET System design 2
ASP.NET System design 2
 
ASP.NET Session 1
ASP.NET Session 1ASP.NET Session 1
ASP.NET Session 1
 
Transport layer
Transport layerTransport layer
Transport layer
 
Routing
RoutingRouting
Routing
 
Network security
Network securityNetwork security
Network security
 
Module ii physical layer
Module ii physical layerModule ii physical layer
Module ii physical layer
 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correction
 
Overview of data communication and networking
Overview of data communication and networkingOverview of data communication and networking
Overview of data communication and networking
 
Application layer
Application layerApplication layer
Application layer
 

Recently uploaded

JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governanceWSO2
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringWSO2
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfdanishmna97
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 

Recently uploaded (20)

JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 

ASP.NET Session 3

  • 2. Objectives 1.Understanding of the language basics to facilitate development. 2.Basic Object Oriented Programming concepts and C# Programming Structure. 3. Language fundamentals 4.Doing our first C# Program. 5. Hands on knowledge in Visual Studio.
  • 3. Introduction • C# (pronounced “See Sharp”) is a simple, modern, object-oriented programming language. • It was made by Microsoft Corporation, more precisely by Anders Hejlsberg. • It was created to use all capacities of .NET platform. The first version appeared in 2001, last update appeared in 2010 with the C# 4.0. • C# has its roots in the C family of languages and will be immediately familiar to C, C++, and Java programmers.
  • 4. Fundamentals of Object Oriented Programming • OOPs design methodology is different from traditional language like BASIC, Pascal, C etc. Those are called the Procedural Language. • In OOP, the emphasis is on Data and not on procedures. Class • In OOP, A class describes all the attributes of objects,as well as the methods that implement the behavior of member object. • A class is only a specification of a data type. • A class is like a blue print of the Object.
  • 5. Fundamentals of Object Oriented Programming(Contd..) Objects • They are instance of classes. • Objects are the central idea behind OOP technology. • An object is a bundle of variables and related methods. • When an object is created memory allocation takes place.
  • 6. Fundamentals of Object Oriented Programming(Contd..) Three principles of object oriented programming 1.Encapsulation • The ability to hide the internals details of an object from the outside world. 2.Inheritance • Hierarchy is used to define more specialized classes based on a preexisting generalized class. 3.Polymorphism • The ability to extend functionality.
  • 7. Abstract Class:  We can not create a object of abstract class.  It only allows other classes to inherit from it but can't be instantiated.  In C# we use Abstract Keyword. Interface  An interface is not a class, is entity.  An interface has no implementation; it only has the signature.  Just the definition of the methods without the body.
  • 8. Partial Class Example • public partial class MyClass • { • partial void DoSomethingElse(); • public void DoSomething() • { Console.WriteLine("DoSomething() execution started."); • DoSomethingElse(); • Console.WriteLine("DoSomething() execution finished.");
  • 9. • Console.ReadKey(); • } • } • public partial class MyClass • { • partial void DoSomethingElse() • { • Console.WriteLine("DoSomethingElse() called."); • } • }
  • 10. • class Program • { • • static void Main(string[] args) • { • MyClass mm = new MyClass(); • mm.DoSomething(); • } • } • }
  • 11. OutPut • DoSomething() execution started. • DoSomethingElse() called. • DoSomething() execution finished.
  • 12. C# Language Fundamentals • Garbage collection automatically reclaims memory occupied by unused objects. • Exception handling provides a structured and extensible approach to error detection and recovery. • Ex: try, catch & finally • C# is case-sensitive.
  • 13. C# Console Application • Console applications in C# have exactly the same purpose as regular console applications: to provide a command line interface with the user. • Console applications have three main input streams: standard in, standard out and standard error. • “Hello World” Program using C#: using System; class Hello { static void Main(String[] args) { Console.WriteLine("Hello, World"); } }
  • 14. C# Console Application in Visual Studio
  • 15. C# Console Application(Contd..) • The "System.Console" class:- The main element in a console application is the "System.Console" class. It contains all methods needed to control the three streams of data. • "ReadLine" method:- The main ways of acquiring data from the standard input stream. "ReadLine" reads a whole line of characters from the buffer up to the point where the first end line character ("n") is found. It outputs its data as "string“.
  • 16. Working with Visual Studio • Microsoft Visual Studio is an Integrated Development Environment (IDE) from Microsoft. • It can be used to develop Console applications along with Windows Forms applications, web sites, web applications, and web services. • Features : 1. Code editor 2. Debugger 3. Designer 4. Other Tools
  • 17. Code editor • Visual Studio includes a code editor that supports syntax highlighting and code completion using IntelliSense for not only variables, functions and methods but also language constructs like loops and queries. • Autocomplete suggestions are popped up in a modeless list box, overlaid on top of the code editor.
  • 18.
  • 19. Debugger • Visual Studio includes a debugger that works both as a source-level debugger and as a machine-level debugger. • It works with both managed code as well as native code and can be used for debugging applications written in any language supported by Visual Studio. • The debugger allows setting breakpoints (which allow execution to be stopped temporarily at a certain position). • The debugger supports Edit and Continue, i.e., it allows code to be edited as it is being debugged (32 bit only; not supported in 64 bit). • When debugging, if the mouse pointer hovers over any variable, its current value is displayed in a tooltip ("data tooltips"), where it can also be modified if desired.
  • 20.
  • 21. Designer • Visual Studio includes a host of visual designers to aid in the development of applications. These tools include: 1. Windows Forms Designer 2. Web designer/development 3. Class designer 4. Data designer
  • 22. Windows Forms Designer • The Windows Forms designer is used to build GUI applications using Windows Forms. • It includes a palette of UI widgets and controls (including buttons, progress bars, labels, layout containers and other controls) that can be dragged and dropped on a form surface. • Layout can be controlled by housing the controls inside other containers or locking them to the side of the form. • Controls that display data (like textbox, list box, grid view, etc.) can be data-bound to data sources like databases or queries. • The designer generates either C# or VB.NET code for the application.
  • 23.
  • 24. Web designer/development • Visual Studio also includes a web-site editor and designer that allows web pages to be authored by dragging and dropping Web controls. • It is used for developing ASP.NET applications and supports HTML, CSS and JavaScript. • It uses a code-behind model to link with ASP.NET code.
  • 25.
  • 26. Class designer • The Class Designer is used to author and edit the classes. • The Class Designer can generate C# and VB.NET code outlines for the classes and methods. • It can also generate class diagrams from hand- written classes.
  • 27.
  • 28. Data designer • The data designer can be used to graphically edit typed database tables, primary and foreign keys and constraints. • It can also be used to design queries from the graphical view.
  • 29.
  • 30.
  • 31.
  • 32. Polymorphism in .Net • What is Polymorphism? Polymorphism means same operation may behave differently on different classes. Example of Compile Time Polymorphism: Method Overloading Example of Run Time Polymorphism: Method Overriding
  • 33. Example of Compile Time Polymorphism Method Overloading - Method with same name but with different arguments is called method overloading. - Method Overloading forms compile-time polymorphism. - Example of Method Overloading: class A1 { void hello() { Console.WriteLine(“Hello”); } void hello(string s) { Console.WriteLine(“Hello {0}”,s); } }
  • 34. Run Time Polymorphism • Method Overriding - Method overriding occurs when child class declares a method that has the same type arguments as a method declared by one of its superclass. - Method overriding forms Run-time polymorphism. - Note: By default functions are not virtual in C# and so you need to write “virtual” explicitly. While by default in Java each function are virtual. - Example of Method Overriding:
  • 35. • Class parent { virtual void hello() { Console.WriteLine(“Hello from Parent”); } } Class child : parent { override void hello() { Console.WriteLine(“Hello from Child”); } } static void main() { parent objParent = new child(); objParent.hello(); } //Output Hello from Child. •
  • 36. Summery Language basics to facilitate development. Basic Object Oriented Programming concepts C# Programming Structure. Language fundamentals Doing our first C# Program. Hands on knowledge in Visual Studio.

Editor's Notes

  1. To use this concept in OOP we derived the idea of Class and Object.
  2. Encapsulation: Also termed as Information hiding , is the ability to hide the internals of an object from its users and also to provide an interface to only those members which you want the client to manipulate. Inheritance : Specification of relationship of one class with another class. A derived class is the new class being created and the base class is the one from which it is derived . Polymorphism : Its is the functionality that allows old code to call new code. Allows you to extend or enhance your system without having to modify old code.