Wednesday, 9 May 2012

Can We inherit the interface into another interface?


For Asp.net Training with C# Click Here

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

Can We inherit the interface into another interface?



Yes we can inherit the interface into another interface. It follows the same signature for inheritance as we use to inherit the class like:-

1.     Create first interface

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

Basic of Interface


For Asp.net Training with C# Click Here

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

Basic of Interface
Interface is an entity which gives signature or a structure which class have to implement. It contains only declaration not definition. The class which implement the interface will give the definition to each member. It means we can only declare the method, property and event.
Simply interface is ‘what’ should be done and its implementation is ‘how’ it should be done.
Note:-1. All members of the Interface declared without access specifier like public, private etc.
2. We cannot declare any variable in interface.
3. All members should be implemented in the derived class.

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
{
}

Thursday, 1 March 2012

Article 5:-How Object is Created?


For Asp.net Training with C# Click Here

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

How Object is Created?
Or
Why classes are called Reference Type

As we know that class is a user defined data type.
For creating the object of any class we write the following code:-
Class_Name  Object_Name=new Class_Name();
Suppose the class name is calculator. Then we create the object like that
Calculator cal = new calculator();

Monday, 13 February 2012

Article 4:-Classes in more detail


For Asp.net Training with C# Click Here

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

Classes in more detail

Class is the way to realize real time entity in oops. It is the user defined data type. If we want to understand the classes in detail then we need to understand the following topics:--

Ø  Constructor:- for understanding the constructor in detail plz read the following link

Ø  Properties
Ø  Indexers

Sunday, 8 January 2012

Interview question on Constructor


For Asp.net Training with C# Click Here

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


1.      What is constructor?
2.      Can class have more than one static constructor?
3.      Can we create private constructor of a class?
4.      What is the type of the constructor?