Вы находитесь на странице: 1из 7

property: it is a member of class,which is used to write data to the datafield and read da ta from the datafield it never stores

the data,just used to transfer the data to perform read and write operations,it has 2 methods/accessor 1) set accessor it is used to write data in the data field this will contain default and fixed variable named as value whenever we call the property to write the data any data we supply will come and store in value variable by default syntax: set { datafile name=value; } example:

2) get accessor get accessor is used to read data from the data field syntax: get { return datafile name; }

OOPS principles: 1) Encapsulation:(wrapping of data) it is a process of binding the member variable of a class to its member function s. encapsulation can be implemented with help of object and also access modifiers l ike private,public,protected

2) Polymorphism: same function/operator will show different behaviours when passed different type of values or different number of values 2 types: static polymorphism // function overloading dynamic polymorphism // function overriding

3) Inheritance: Creating a new class from existing class is called as inheritance. When a new class needs same members as an existing class then instead of creating those members again in new class, the new class can be created from existing class, which is called as inheritance. types of inheritance: single inheritance: creating a new class from single base class is known as single inheritance multiple inheritance: creating a new class form two or more base classes is known as multiple inherita nce. C# does not support Multiple inheritance due to ambiguity problem. By using Interfaces we can achieve Multiple inheritance. multilevel inheritance: creating a new class from already derived class is known as multilevel inheritan ce hybrid inheritance: this is combination of both multiple and multilevel inheritance hierrarcial inheritance: When two or more classes are derived from a single base class abstract function: a function which contains only declaration and doesn't contains implementation i s known as abstract function to make any function as abstract use abstract keyword overriding of an abstract function is compulsory

abstract class: a class which contains one or more abstract functions is known as abstract class to make any class as abstract use abstract keyword

its compulsory to derive a new class from an abstract class in order to provide implementation to its abstract functions an abstract class can contain non-abstract functions interface: if a class contains all abstract functions then it is known as interface interfaces do not provide implementation. They are implemented by classes and de fined as seperate entities from classes. by default interface functions are treated as public and abstract sealed class: a class which is not possible to derive a new class is known as sealed class to make any class sealed we use sealed keyword a sealed class cannot contain abstract,virtual functions partial class: a class which code can be written in two or more files is known as partial class to make any class as partial use partial keyword partial classes will provide flexibility in development

generics: these are general data types using generics we will write generic methods,generic classes the data types used in generics can be obtained with the help of reflection at r untime. delegate: it is used to represent one or more functions it is not a memeber of class but similar to a class to consume any delegate we need to create object for delegate a delegate is a type that references a method

exception handling: when we write and execute our code in .net there is possibility of three types of error occurence syntactical errors compilation errors runtime errors

syntactical errors: these errors occur by typing wrong syntax like missing double quotes terminators , typing wrong spelling for keywords etc. programmer can identify these errors while writing the code and can be rectified . these errors do not cause any harm to the program execution. compilation errors: these errors occur when program is compiled these errors like assigning wrong data to a variable , trying to create object f or abstract class or interface etc these errors can be identified by the programmer and can be rectified ,before ex ecution of the program only these errors do not cause any harm to the program execution runtime errors: these errors will occur at the time of execting the program these errors are like entering wrong data in to a variable , trying to open a fi le for which there is no permission, trying to connect to data base with wrong use id and password etc exception : a runtime error is called an exception exception cant be identified and rectified by the programmer exceptions will cause abnormal termination of the program execution.

so, to avoid abnormal termination of program execution, we need to handle the ex ceptions methods to handle exceptions: there are 3 methods: logical implementation try catch implementation on error go to implementation logical implementation: in this method we handle the exception by using logical statements in real time programming first and fore most importance should be given for logi cal implementation only

try catch implementation: try : this block contains all the statements in which there is possibility of exceptio n occurence catch: this block contains all the statements to handle the exception that is raised wi th in the try block finally: this contains the statements to be executed compulsory though try block is execu ted or catch block is executed on error implementation: using exception classes

component :

a component is a reusable piece of code and is in the form of dll once the component is designed it can be reused from any king of application like in console application ,windows application, web application once a component is designed in any programming language of .net that can be reu sed from any other programming languages of .net all ways end user interact with some applicatinon and the application will inter act with compenent or dll

Вам также может понравиться