Sie sind auf Seite 1von 1

Abstract Class: 1. At least one method in the Abstract class should not have body. 2.

We cannot create object to abstract class, we can inherit it. Sealed Class: 1. It is opposite to Abstract class. 2. We can create object for the sealed class but we cannot inherit a sealed class. Interfaces: 1. C sharp does not support multiple inheritances; this flaw can be overcome by using the concept of Interfaces. 2. We can declare n number of methods in the interface. 3. Interface contains only signatures. 4. We should give body to all the methods. Encapsulation: In encapsulation both the state and the behavior of the class will be together. State: State is the data in the method. Behavior: Behavior is the purpose of usage of the class. Ex: in banking we have account and account number, these are nothing but state of the method. Behavior is the purpose of the class, means weather it belongs to debit or credit .. etc. In C sharp we can achieve this in 5 ways 1. Public: Accessible anywhere. 2. Private: Accessible with in the class. 3. Internal: Accessible with in the namespace. 4. Protected: Accessible in the inherited classes. 5. Protected Internal: Accessible in the inherited classes and inside the namespace. WCF: Can be hosted in IIS, Windows Services, Self-Hosting and Windows Activation Services Hosting. WPF: Windows Services. WINDOWS SERVICE: Can be hosted in Services.

Das könnte Ihnen auch gefallen