SlideShare a Scribd company logo
1 of 13
iFour ConsultancyBasics of .Net
Constructor is a special method of a class which will invoke automatically when instance or object of class is created. Constructors are responsible for object
initialization and memory allocation of its class. If we create any class without constructor, the compiler will automatically create one default constructor for
that class. There is always at least one constructor in every class.
Basically constructors are 5 types those are
 Default Constructor
 Static Constructor
 Private Constructor
 Parameterized Constructor
 Copy Constructor
Example:
class SampleA
{
public SampleA()
{
Console.WriteLine("Sample A Test Method");
}
}
Constructor
http://www.ifourtechnolab.com Software development company india
A data type in a coding language is a set of data with values having predefined characteristics. Examples of data
types are: character, string, integer, floating point unit number, and pointer. Usually, a limited number of such data
types come built into a language. The language usually specifies the range of values for a given data type, how the
values are processed by the computer, and how they are stored.
Two types of Datatypes are present in .net Application
i. Reference type - The reference types do not contain the actual data stored in a variable, but
they contain a reference to the variables. n other words, they refer to a memory location.
Using multiple variables, the reference types can refer to a memory location. If the data in the
memory location is changed by one of the variables, the other variable automatically reflects
this change in value. Example of built-in reference types are: object, dynamic and string.
ii. Value type - Value type variables can be assigned a value directly. They are derived from the class
System.ValueType. The value types directly contain data. Some examples are char ,int, and float, which
stores numbers, alphabets, and floating point numbers, respectively. When you declare an int type, the
system allocates memory to store the value.
Data Types
Software development company indiahttp://www.ifourtechnolab.com
A control statement is a statement that determines whether other statements will be executed.
o An if statement decides whether to execute another statement, or decides which of two
statements to execute.
o A loop decides how many times to execute another statement. There are three kinds of loops:
o for loops are (typically) used to execute the controlled statement a given number of times.
o while loops test whether a condition is true before executing the controlled statement.
o do-while loops test whether a condition is true after executing the controlled statement.
o A switch statement decides which of several statements to execute.
Control statements
Software development company indiahttp://www.ifourtechnolab.com
Properties are as in everyday language and technically are fields of objects/classes with
dedicated getter/setter routines (which can be considered as methods. There are
languages that don't have properties and this behavior is achieved using a private field +
get/set methods.).
Methods ("member functions") are similar to functions, they belongs to classes or objects
and usually expresses the verbs of the objects/class. For example, an object of type
Window usually would have methods open and close which do corresponding operations
to the object they belong.
Properties and Methods
Software development company indiahttp://www.ifourtechnolab.com
 In .Net, a structure is a value type data type. It helps you to make a single variable hold related data of various data
types. The struct keyword is used for creating a structure. To define a structure, you must use the struct statement. The
struct statement defines a new data type, with more than one member for your program. Few Properties of structure
 Unlike classes, structures cannot inherit other structures or classes.
 Structures cannot be used as a base for other structures or classes.
 A structure can implement one or more interfaces.
 Structure members cannot be specified as abstract, virtual, or protected.
 classes are reference types and structs are value types
For example, here is the way you can declare the Book structure:
struct Books
{
public string title;
public string author;
public string subject;
public int book_id;
};
Structure
Software development company indiahttp://www.ifourtechnolab.com
An abstract class cannot be instantiated. The purpose of an abstract class is to provide a common definition
of a base class that multiple derived classes can share. For example, a class library may define an abstract
class that is used as a parameter to many of its functions, and require programmers using that library to
provide their own implementation of the class by creating a derived class.
Abstract methods have no implementation, so the method definition is followed by a semicolon instead of a
normal method block. Derived classes of the abstract class must implement all abstract methods. When an
abstract class inherits a virtual method from a base class, the abstract class can override the virtual method
with an abstract method.
Classes can be declared as abstract by putting the keyword abstract before the class definition. For example:
public abstract class A
{
// Class members here.
}
Abstract Classes
Software development company indiahttp://www.ifourtechnolab.com
An interface contains definitions for a group of related functionalities that a class or a struct can implement. The public definitions comprise the interface for the class,
which should never change, and a contract between the creator of the class and the users of the class. An interface looks like a class, but has no implementation. The
only thing it contains are declarations of events, indexers, methods and/or properties. The reason interfaces only provide declarations is because they are inherited by
classes and structs, which must provide an implementation for each interface member declared.
Defining an Interface:
interface IMyInterface
{
void MethodToImplement();
}
Using an Interface:
class InterfaceImplementer : IMyInterface
{
static void Main()
{
InterfaceImplementer iImp = new InterfaceImplementer();
iImp.MethodToImplement();
}
public void MethodToImplement()
{
Console.WriteLine("MethodToImplement() called.");
}
}
Interface
Software development company indiahttp://www.ifourtechnolab.com
Delegate and Event concepts are completely tied together. Delegates are just function pointers, That is, they hold references to
functions.
A Delegate is a class. When you create an instance of it, you pass in the function name (as a parameter for the delegate's
constructor) to which this delegate will refer.
Every delegate has a signature. For example:
delegate int SomeDelegate(string s, bool b);
The Event model in .net Languages finds its roots in the event programming model that is popular in asynchronous
programming. The basic foundation behind this programming model is the idea of "publisher and subscribers." In this model,
you have publishers who will do some logic and publish an "event." Publishers will then send out their event only to subscribers
who have subscribed to receive the specific event.
• The following important conventions are used with events:
• Event Handlers in the .NET Framework return void and take two parameters.
• The first paramter is the source of the event; that is the publishing object.
• The second parameter is an object derived from EventArgs.
• Events are properties of the class publishing the event.
• The keyword event controls how the event property is accessed by the subscribing classes.
Delegates and Events
Software development company indiahttp://www.ifourtechnolab.com
The More quoted word is Exception Handling and is defined as:
An exception is a problem that arises during the execution of a program. An exception is a response to an exceptional circumstance that arises
while a program is running, such as an attempt to divide by zero.
Exceptions provide a way to transfer control from one part of a program to another. C# exception handling is built upon four
keywords: try, catch, finally, and throw.
 try: A try block identifies a block of code for which particular exceptions is activated. It is followed by one or more catch blocks.
 catch: A program catches an exception with an exception handler at the place in a program where you want to handle the problem. The catch
keyword indicates the catching of an exception.
 finally: The finally block is used to execute a given set of statements, whether an exception is thrown or not thrown. For example, if you open
a file, it must be closed whether an exception is raised or not.
 throw: A program throws an exception when a problem shows up. This is done using a throw keyword.
Example:
try
{
// statements causing exception
}
catch( ExceptionName e1 ){ // error handling code}
catch( ExceptionName eN ){ // error handling code}
finally{ // statements to be executed }
Error Handling
Software development company indiahttp://www.ifourtechnolab.com
Static is a keyword which denotes things that are singular. They are part of no instance. Static often improves performance, but
makes programs less flexible. These are called with the type name. No instance is required—this makes them slightly faster.
Static methods can be public or private.
For Eg:
static class Perls
{
public static int value = 5;
}
It can be accessed directly by using Class For Eg: Perls.value which will return 5.
The virtual keyword is used to modify a method, property, indexer, or event declaration and allow for it to be overridden in a
derived class. For example, this method can be overridden by any class that inherits it. For Eg:
public virtual double Area()
{
return x * y;
}
Static and virtual Keyword
Software development company indiahttp://www.ifourtechnolab.com
In the common language runtime (CLR), the garbage collector serves as an automatic
memory manager. It provides the following benefits:
 Enables you to develop your application without having to free memory.
 Allocates objects on the managed heap efficiently.
 Reclaims objects that are no longer being used, clears their memory, and keeps the
memory available for future allocations. Managed objects automatically get clean
content to start with, so their constructors do not have to initialize every data field.
 Provides memory safety by making sure that an object cannot use the content of
another object.
Garbage Collection
Software development company indiahttp://www.ifourtechnolab.com
Thank you
Software development company indiahttp://www.ifourtechnolab.com

More Related Content

Viewers also liked

Using MongoDB with the .Net Framework
Using MongoDB with the .Net FrameworkUsing MongoDB with the .Net Framework
Using MongoDB with the .Net FrameworkStefano Paluello
 
Find out Which Versions of the .NET Framework are Installed on a PC.
Find out Which Versions of the .NET Framework are Installed on a PC.Find out Which Versions of the .NET Framework are Installed on a PC.
Find out Which Versions of the .NET Framework are Installed on a PC.raj upadhyay
 
ASP.NET Core, .NET Core e EF Core: multiplataforma e otimizados para a nuvem
ASP.NET Core, .NET Core e EF Core: multiplataforma e otimizados para a nuvemASP.NET Core, .NET Core e EF Core: multiplataforma e otimizados para a nuvem
ASP.NET Core, .NET Core e EF Core: multiplataforma e otimizados para a nuvemRogério Moraes de Carvalho
 
Using The .NET Framework
Using The .NET FrameworkUsing The .NET Framework
Using The .NET FrameworkLearnNowOnline
 
Inside .net framework
Inside .net frameworkInside .net framework
Inside .net frameworkFaisal Aziz
 
.net framework from 1.0 -> 4.0
.net framework from 1.0 -> 4.0.net framework from 1.0 -> 4.0
.net framework from 1.0 -> 4.0ligaoren
 
Dotnet Frameworks Version History
Dotnet Frameworks Version HistoryDotnet Frameworks Version History
Dotnet Frameworks Version Historyvoltaincx
 
Overview of .Net Framework 4.5
Overview of .Net Framework 4.5Overview of .Net Framework 4.5
Overview of .Net Framework 4.5Bhushan Mulmule
 
Introduction to .NET Programming
Introduction to .NET ProgrammingIntroduction to .NET Programming
Introduction to .NET ProgrammingKarthikeyan Mkr
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Jeff Blankenburg
 
Visual Studio 2010 and .NET Framework 4.0 Overview
Visual Studio 2010 and .NET Framework 4.0 OverviewVisual Studio 2010 and .NET Framework 4.0 Overview
Visual Studio 2010 and .NET Framework 4.0 OverviewHarish Ranganathan
 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework OverviewDoncho Minkov
 

Viewers also liked (16)

Using MongoDB with the .Net Framework
Using MongoDB with the .Net FrameworkUsing MongoDB with the .Net Framework
Using MongoDB with the .Net Framework
 
Introduction of .net framework
Introduction of .net frameworkIntroduction of .net framework
Introduction of .net framework
 
Find out Which Versions of the .NET Framework are Installed on a PC.
Find out Which Versions of the .NET Framework are Installed on a PC.Find out Which Versions of the .NET Framework are Installed on a PC.
Find out Which Versions of the .NET Framework are Installed on a PC.
 
ASP.NET Core, .NET Core e EF Core: multiplataforma e otimizados para a nuvem
ASP.NET Core, .NET Core e EF Core: multiplataforma e otimizados para a nuvemASP.NET Core, .NET Core e EF Core: multiplataforma e otimizados para a nuvem
ASP.NET Core, .NET Core e EF Core: multiplataforma e otimizados para a nuvem
 
Using The .NET Framework
Using The .NET FrameworkUsing The .NET Framework
Using The .NET Framework
 
Inside .net framework
Inside .net frameworkInside .net framework
Inside .net framework
 
.Net framework
.Net framework.Net framework
.Net framework
 
.net framework from 1.0 -> 4.0
.net framework from 1.0 -> 4.0.net framework from 1.0 -> 4.0
.net framework from 1.0 -> 4.0
 
Dotnet Frameworks Version History
Dotnet Frameworks Version HistoryDotnet Frameworks Version History
Dotnet Frameworks Version History
 
Overview of .Net Framework 4.5
Overview of .Net Framework 4.5Overview of .Net Framework 4.5
Overview of .Net Framework 4.5
 
Introduction to .NET Programming
Introduction to .NET ProgrammingIntroduction to .NET Programming
Introduction to .NET Programming
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
 
Dotnet basics
Dotnet basicsDotnet basics
Dotnet basics
 
Introduction to .NET Framework
Introduction to .NET FrameworkIntroduction to .NET Framework
Introduction to .NET Framework
 
Visual Studio 2010 and .NET Framework 4.0 Overview
Visual Studio 2010 and .NET Framework 4.0 OverviewVisual Studio 2010 and .NET Framework 4.0 Overview
Visual Studio 2010 and .NET Framework 4.0 Overview
 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework Overview
 

More from Jignesh Aakoliya

Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaJignesh Aakoliya
 
Understanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company indiaUnderstanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company indiaJignesh Aakoliya
 
Overview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company indiaOverview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company indiaJignesh Aakoliya
 
Overview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company indiaOverview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company indiaJignesh Aakoliya
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaJignesh Aakoliya
 
Basics of html for web development by software outsourcing company india
Basics of html for web development   by software outsourcing company indiaBasics of html for web development   by software outsourcing company india
Basics of html for web development by software outsourcing company indiaJignesh Aakoliya
 

More from Jignesh Aakoliya (6)

Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company india
 
Understanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company indiaUnderstanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company india
 
Overview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company indiaOverview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company india
 
Overview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company indiaOverview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company india
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
 
Basics of html for web development by software outsourcing company india
Basics of html for web development   by software outsourcing company indiaBasics of html for web development   by software outsourcing company india
Basics of html for web development by software outsourcing company india
 

Recently uploaded

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
"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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Recently uploaded (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
"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 ...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Basics of .net framework by software outsourcing company india

  • 2. Constructor is a special method of a class which will invoke automatically when instance or object of class is created. Constructors are responsible for object initialization and memory allocation of its class. If we create any class without constructor, the compiler will automatically create one default constructor for that class. There is always at least one constructor in every class. Basically constructors are 5 types those are  Default Constructor  Static Constructor  Private Constructor  Parameterized Constructor  Copy Constructor Example: class SampleA { public SampleA() { Console.WriteLine("Sample A Test Method"); } } Constructor http://www.ifourtechnolab.com Software development company india
  • 3. A data type in a coding language is a set of data with values having predefined characteristics. Examples of data types are: character, string, integer, floating point unit number, and pointer. Usually, a limited number of such data types come built into a language. The language usually specifies the range of values for a given data type, how the values are processed by the computer, and how they are stored. Two types of Datatypes are present in .net Application i. Reference type - The reference types do not contain the actual data stored in a variable, but they contain a reference to the variables. n other words, they refer to a memory location. Using multiple variables, the reference types can refer to a memory location. If the data in the memory location is changed by one of the variables, the other variable automatically reflects this change in value. Example of built-in reference types are: object, dynamic and string. ii. Value type - Value type variables can be assigned a value directly. They are derived from the class System.ValueType. The value types directly contain data. Some examples are char ,int, and float, which stores numbers, alphabets, and floating point numbers, respectively. When you declare an int type, the system allocates memory to store the value. Data Types Software development company indiahttp://www.ifourtechnolab.com
  • 4. A control statement is a statement that determines whether other statements will be executed. o An if statement decides whether to execute another statement, or decides which of two statements to execute. o A loop decides how many times to execute another statement. There are three kinds of loops: o for loops are (typically) used to execute the controlled statement a given number of times. o while loops test whether a condition is true before executing the controlled statement. o do-while loops test whether a condition is true after executing the controlled statement. o A switch statement decides which of several statements to execute. Control statements Software development company indiahttp://www.ifourtechnolab.com
  • 5. Properties are as in everyday language and technically are fields of objects/classes with dedicated getter/setter routines (which can be considered as methods. There are languages that don't have properties and this behavior is achieved using a private field + get/set methods.). Methods ("member functions") are similar to functions, they belongs to classes or objects and usually expresses the verbs of the objects/class. For example, an object of type Window usually would have methods open and close which do corresponding operations to the object they belong. Properties and Methods Software development company indiahttp://www.ifourtechnolab.com
  • 6.  In .Net, a structure is a value type data type. It helps you to make a single variable hold related data of various data types. The struct keyword is used for creating a structure. To define a structure, you must use the struct statement. The struct statement defines a new data type, with more than one member for your program. Few Properties of structure  Unlike classes, structures cannot inherit other structures or classes.  Structures cannot be used as a base for other structures or classes.  A structure can implement one or more interfaces.  Structure members cannot be specified as abstract, virtual, or protected.  classes are reference types and structs are value types For example, here is the way you can declare the Book structure: struct Books { public string title; public string author; public string subject; public int book_id; }; Structure Software development company indiahttp://www.ifourtechnolab.com
  • 7. An abstract class cannot be instantiated. The purpose of an abstract class is to provide a common definition of a base class that multiple derived classes can share. For example, a class library may define an abstract class that is used as a parameter to many of its functions, and require programmers using that library to provide their own implementation of the class by creating a derived class. Abstract methods have no implementation, so the method definition is followed by a semicolon instead of a normal method block. Derived classes of the abstract class must implement all abstract methods. When an abstract class inherits a virtual method from a base class, the abstract class can override the virtual method with an abstract method. Classes can be declared as abstract by putting the keyword abstract before the class definition. For example: public abstract class A { // Class members here. } Abstract Classes Software development company indiahttp://www.ifourtechnolab.com
  • 8. An interface contains definitions for a group of related functionalities that a class or a struct can implement. The public definitions comprise the interface for the class, which should never change, and a contract between the creator of the class and the users of the class. An interface looks like a class, but has no implementation. The only thing it contains are declarations of events, indexers, methods and/or properties. The reason interfaces only provide declarations is because they are inherited by classes and structs, which must provide an implementation for each interface member declared. Defining an Interface: interface IMyInterface { void MethodToImplement(); } Using an Interface: class InterfaceImplementer : IMyInterface { static void Main() { InterfaceImplementer iImp = new InterfaceImplementer(); iImp.MethodToImplement(); } public void MethodToImplement() { Console.WriteLine("MethodToImplement() called."); } } Interface Software development company indiahttp://www.ifourtechnolab.com
  • 9. Delegate and Event concepts are completely tied together. Delegates are just function pointers, That is, they hold references to functions. A Delegate is a class. When you create an instance of it, you pass in the function name (as a parameter for the delegate's constructor) to which this delegate will refer. Every delegate has a signature. For example: delegate int SomeDelegate(string s, bool b); The Event model in .net Languages finds its roots in the event programming model that is popular in asynchronous programming. The basic foundation behind this programming model is the idea of "publisher and subscribers." In this model, you have publishers who will do some logic and publish an "event." Publishers will then send out their event only to subscribers who have subscribed to receive the specific event. • The following important conventions are used with events: • Event Handlers in the .NET Framework return void and take two parameters. • The first paramter is the source of the event; that is the publishing object. • The second parameter is an object derived from EventArgs. • Events are properties of the class publishing the event. • The keyword event controls how the event property is accessed by the subscribing classes. Delegates and Events Software development company indiahttp://www.ifourtechnolab.com
  • 10. The More quoted word is Exception Handling and is defined as: An exception is a problem that arises during the execution of a program. An exception is a response to an exceptional circumstance that arises while a program is running, such as an attempt to divide by zero. Exceptions provide a way to transfer control from one part of a program to another. C# exception handling is built upon four keywords: try, catch, finally, and throw.  try: A try block identifies a block of code for which particular exceptions is activated. It is followed by one or more catch blocks.  catch: A program catches an exception with an exception handler at the place in a program where you want to handle the problem. The catch keyword indicates the catching of an exception.  finally: The finally block is used to execute a given set of statements, whether an exception is thrown or not thrown. For example, if you open a file, it must be closed whether an exception is raised or not.  throw: A program throws an exception when a problem shows up. This is done using a throw keyword. Example: try { // statements causing exception } catch( ExceptionName e1 ){ // error handling code} catch( ExceptionName eN ){ // error handling code} finally{ // statements to be executed } Error Handling Software development company indiahttp://www.ifourtechnolab.com
  • 11. Static is a keyword which denotes things that are singular. They are part of no instance. Static often improves performance, but makes programs less flexible. These are called with the type name. No instance is required—this makes them slightly faster. Static methods can be public or private. For Eg: static class Perls { public static int value = 5; } It can be accessed directly by using Class For Eg: Perls.value which will return 5. The virtual keyword is used to modify a method, property, indexer, or event declaration and allow for it to be overridden in a derived class. For example, this method can be overridden by any class that inherits it. For Eg: public virtual double Area() { return x * y; } Static and virtual Keyword Software development company indiahttp://www.ifourtechnolab.com
  • 12. In the common language runtime (CLR), the garbage collector serves as an automatic memory manager. It provides the following benefits:  Enables you to develop your application without having to free memory.  Allocates objects on the managed heap efficiently.  Reclaims objects that are no longer being used, clears their memory, and keeps the memory available for future allocations. Managed objects automatically get clean content to start with, so their constructors do not have to initialize every data field.  Provides memory safety by making sure that an object cannot use the content of another object. Garbage Collection Software development company indiahttp://www.ifourtechnolab.com
  • 13. Thank you Software development company indiahttp://www.ifourtechnolab.com

Editor's Notes

  1. Software development company india – http://www.ifourtechnolab.com
  2. Software development company india – http://www.ifourtechnolab.com
  3. Software development company india – http://www.ifourtechnolab.com
  4. Software development company india – http://www.ifourtechnolab.com
  5. Software development company india – http://www.ifourtechnolab.com
  6. Software development company india – http://www.ifourtechnolab.com
  7. Software development company india – http://www.ifourtechnolab.com
  8. Software development company india – http://www.ifourtechnolab.com
  9. Software development company india – http://www.ifourtechnolab.com
  10. Software development company india – http://www.ifourtechnolab.com
  11. Software development company india – http://www.ifourtechnolab.com
  12. Software development company india – http://www.ifourtechnolab.com
  13. Software development company india – http://www.ifourtechnolab.com