Showing posts with label Inheritance. Show all posts
Showing posts with label Inheritance. Show all posts

Tuesday, 10 April 2012

Access specifier in C#


For Asp.net Training with C# Click Here

Written By:-Isha Malhotra
Email:-malhotra.isha3388@gmail.com

Access specifier in C#
Access specifier defines the accessibility of class member. We can restrict and limit the accessibility of member of classes.
Access Specifier and their accessibility
Access Spicifier
With in class
Derived Class
Outside Class
With in Assembly
Public
Yes
Yes
Yes
Yes
Private
Yes
No
No
No
Protected
Yes
Yes
No
No
Internal
Yes
No
No
Yes
Protected internal
Yes
Yes
No
yes

Above table defines the accessibility of all access spicifier. As this table describe that public member can be accessd everywhere and private accessed only with in class. This create the protection level  that except the class member no other can access the private member of class.

Saturday, 7 April 2012

Basic of Inheritance for beginner


For Asp.net Training with C# Click Here

Written By:-Isha Malhotra
Email:-malhotra.isha3388@gmail.com


Basic of Inheritance for beginners

Inheritance is property of oops by which we access one class into another class without writing the whole code. The class that is inherited is called base class and the class that does the inheritance is called a derived class.
Note:- two way of accessing class.1. create the object of class. 2. Inherit this class.
Syntax for inheritance
Access-modifier class derived-class: base class
{
}