Top Banner
.NET Framework: .NET IS A FRAMEWORK TOOL AND IT IS AN INTEGRAL WINDOWS COMPONENT THAT SUPPORTS BUILDING AND RUNNING THE NEXT GENERATION OF APPLICATIONS AND XML WEB SERVICES. .NET SUPPORTS 61 PROGRAMMING LANGUAGES OUT OF WHICH 9 ARE DESIGNED BY MICROSOFT.
22
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Net framework

.NET Framework:

.NET IS A FRAMEWORK TOOL AND IT IS AN INTEGRAL WINDOWS COMPONENT THAT SUPPORTS BUILDING AND RUNNING THE NEXT GENERATION OF APPLICATIONS AND XML WEB SERVICES.

.NET SUPPORTS 61 PROGRAMMING LANGUAGES OUT OF WHICH 9 ARE DESIGNED BY MICROSOFT.

Page 2: Net framework

VERSIONS:

Page 3: Net framework

.NET COMPILATIONIn .Net code is compiled twice.In first compilation source code is compiled by

respective language compiler and an intermediate code is generated known as MSIL (Microsoft Intermediate Language).

In second compilation MSIL is converted into Native code using CLR.

Page 4: Net framework

Framework Class Library (FCL)

Framework class library is a huge library of reusable types for use by managed code.

It is the library of classes, interfaces and value types that provides access to system functions.

It is designed to be the foundation on which .Net framework applications, components and controls are built.

Page 5: Net framework

The hierarchy of class library-----

Page 6: Net framework

Namespace

• Namespaces are the reusable concept in c#.net.• Every namespace is a DLL file.• Microsoft implemented object oriented programming

concept in the namespaces.• It is a container that provides context for the identifiers.• A namespace provides classes, structures, enumerations,

delegates, interfaces and other namespaces.

Page 7: Net framework

Namespace contd. :• In .net framework “system” is the base namespace.

• Ex:

• using System;

• using System.Data;

• using System.Collections.Generic;

• using System.Windows.Forms;

• using System.Text;

• using System.Linq;

• using System.Threading;

• using System.Drawing;

Page 8: Net framework

Namespace contd. :• To declare scope for types in a namespace………

• Namespace NamespaceName

• {

• Class ClassName { }

• Interface InterfaceName { }

• Struct StructureName { }

• Enum EnumerationName {a,b}

• Delegate void DelegateName (int i);

• Namespace NamespaceName.Nested

• {

• Class ClassName { }

• }

• }

Page 9: Net framework

Structure of C#.Net program

• List of Class Library Namespaces

• Namespace Namespace Name

• {

• Class Class Name

• {

• Static void main (string [ ] args)

• {

• Statements;

• }

• }

• }

Page 10: Net framework

Escape Sequence:• \n new line

• \r carriage return

• \t horizontal tab

• \v vertical tab

• \b backspace

• \f form feed

• \’ single quote

• \” double quote

• \\ backslash

• \0 null

• \a alert

Page 11: Net framework

Identifiers:

• Identifiers are the sequence of characters used to identify variable, constants, properties, methods, object, types etc.

• C# identifiers are case-sensitive i.e. variable names sum, Sum, SUM are different from each other.

• An identifier must begin with either a letter or an underscore.

• It must not be a reserved keyword.

• It must be a complete word without any blank space.

Page 12: Net framework

Keywords:

• Keywords are predefined, reserved identifiers that have special meanings to the compiler.

• They are similar to the identifiers but you can’t use them as variable names, methods and properties.

• If you want to use the keywords as identifiers, prefix the keyword with ‘@’ character.

Page 13: Net framework

Constant:

• A constant is a type but its value is fixed throughout the program execution. Once the program gets compiled its value can’t be changed.

• A variable is declared as constant using “const” keyword.

• Constants are useful when you know the value of a variable at compile time.

Page 14: Net framework

Console:

• Console is a class used to work with input and output streams.

• This class is present in System namespace.

• This class has following methods/functions……

• Write(“message”)

• WriteLine(“message”)

• Read()

• ReadLine()

• Clear()

Page 15: Net framework

OPERATORS

Page 16: Net framework

Primary:

• x.y : dot – used to access member variables and methods of a class

• f(x) : parenthesis – used to convert the types

• a[x] : square brackets – used with arrays, pointers and attributes

• x++ : post increment

• x-- : post decrement

• new : used to create objects and call the constructors

Page 17: Net framework

Unary:• + : unary plus

• - : unary minus

• ! : logical complement

• ~ : bitwise complement

• ++x : pre-increment

• --x : pre-decrement

Page 18: Net framework

Foreach:• It continues to execute the loop body for each element in an array or

object collection.

• Here the data type of loop variable must be same as data type of array/collection.

• Syntax….

• Foreach (datatype variable in array/list collection name)

• {

• Statements;

• }

Page 19: Net framework

ARRAY TYPES:• Normal array : An array which occupies a memory size of less than 64kb is known

as normal array.

• Huge array : An array which occupies a memory size more than 64kb is known as huge array.

• Static array : An array whose physical size is fixed and can’t be changed at runtime is known as static array.

• Dynamic array : An array whose physical size is not fixed throughout the program execution and can be changed at runtime is known as dynamic array.

• Array size can be changed during program execution using “Resize( )” of array class.

• Jagged array : An array which contains another array within it is known a jagged array. It is also called array of arrays.

Page 20: Net framework

SYNTAX OF ARRAYS:• datatype[ ] array name = new datatype [size];• datatype[ ] array name = new datatype [size]

{initializing elements};• datatype[ ] array name = new datatype [ ]

{initializing elements};

Page 21: Net framework

Array Object:• When we create any array with any name then the array is treated as an

object.

• “copy to()” method of array object is used to copy elements of one array to another array.

• Syntax:- array object.copyto(destination array,index);

• “length” property of array object returns the size of an array.

• Syntax:- array object.Length

• “rank” property returns the number of dimension present within the array.

• Syntax:- array object.Rank

Page 22: Net framework

Array class:

• reverse(array name, *int index, *int length);

• sort(array name, *int index, *int length);

• clear(array name, *int index, *int length);

• copy(source array, *int source index, destination array, *int destination index, int length);

• * are optional