You are on page 1of 2

Modifier: 1. Public: method can be accessed any where including outside class. 2.

Protected:- the method can be accessed within the class to which it belongs or a class derived from that class 3. Private: - methods can be accessed inside the class to which it belongs. 4. New: - the method hides and inherited method with the same signature. 5. Internal: - method can be accessed within same program. 6. Static: - method does not operate an specific instance of class. 7. Virtual:- method can be override by derived class 8. Abstract: - a virtual method which defines signature of the method but does not provides an implementations. 9. Override: - method overrides an inherited, virtual or abstract method. 10. Sealed: - the method overrides an inherited virtual method but cannot overridden by this class. 11. Extern: - method is implemented externally in different language. Charactertics of C# 1. Simple: - C# simplifies cpp by eliminating operator such as ->, ::, & pointer (&). It treats integer and Boolean data type as two different types. This means that the use of = in place of == in if statement will be caught by compiler. 2. Modern:- it support automatic garbage collection modern approach to debugging reach intrinsic model for error handling robust security model. 3. Object oriented: - it is truly object oriented language. It supports encapsulation, inheritance, and polymorphism. There is no any global function. 4. Type safety: - type safety promote robust program. C# incorporates number of type safety measures. i) Use of any uninitialized variable produce and error. ii) Access to array is range checked and warns if it goes on out of it. iii) C# permits overflow checking arithmetic operations. 5. Versoinable: - Making new versions of software and work with existing application is known as versioning. C# support versioning with help of new and overwrite keyword. 6. Interoperability: - C# support for using COM object. No matter what language was used. C# also supports a special feature that enables a program to call out any native API (Application Programming Interface).

Type conversion:In c# type conversion takes place in two ways 1. Implicit conversion:These are those that will always successes that are conversion can always be performing without any loss of data. e.g. short converted in int because it is subset of int. C# doses the conversion automatically. An implicit conversion is also known as automatic type conversion. The process of assigning a smaller type to a larger bulb is known as widening or promotion and that of assigning larger type to smaller type is known as narrowing. Narrowing may result in loss of data 2. Explicit conversion:We can explicitly convert the data type that is larger to a smaller by using cast operator which is known as casting. Syntax:Datatype variable1= (type) variable2; The destination type is placed in parenthesis before source variable.

You might also like