.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.
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
.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.
VERSIONS:
.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.
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.
The hierarchy of class library-----
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.
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;
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 { }
• }
• }
Structure of C#.Net program
• List of Class Library Namespaces
• Namespace Namespace Name
• {
• Class Class Name
• {
• Static void main (string [ ] args)
• {
• Statements;
• }
• }
• }
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
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.
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.
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.
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()
OPERATORS
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
Unary:• + : unary plus
• - : unary minus
• ! : logical complement
• ~ : bitwise complement
• ++x : pre-increment
• --x : pre-decrement
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;
• }
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.
SYNTAX OF ARRAYS:• datatype[ ] array name = new datatype [size];• datatype[ ] array name = new datatype [size]
{initializing elements};• datatype[ ] array name = new datatype [ ]
{initializing elements};
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.