Interface and Abstract class, inheritance, abstraction with
examples. Polymorphism (difference betn overloading and
overriding

Answer Posted / alb.shah

Abstract class:
Abstract class act as base class, not instantiable, no
implementaiotn in base class but allow implementaiotn in
derived class with overide method, method must be abstract.
specially used in inheritance.

Interface:

Interface class dont have constructor, destructor,
always public modifier set to true
no implementation
cant used multiple inheritance instead of this we use
multiple interface

Inheritance :

In Inheritance we can use one class property into another
class..
using System;
class sample
{
public void display()
{
Console.WriteLine("C#");
}
}
class sample1:sample
//(Inheriting the property of class sample in class sample1)
{
public void disp()
{
Console.WriteLine("C++");
}
}
class Test
{
public static void Main()
{
sample1 sm=new sample1(); //creating a object of sample1
sm.display(); //accessing function of sample class
sm.disp();
}

Abstraction :

"Abstraction" simply means showing only those details to
the user which are of use to them , and hiding up the
unnecessary
Abstraction is the process or result of generalization by
reducing the information content of a concept or an
observable phenomenon

polimorphism :

polimorphism is the one of the oops features, allows one
object to appear in different form by changing the type.

Two types:
1- Static eg:method overloading
2- Dynamic eg:method overriding

difference betn overloading and overriding :

OverLoading means one name many forms .its functionallty
changes corresponding to the objects
Overriding means its funcationality can be overrided.these
can be done by using by using two keywords
1.overrideable
2.overrides
overriding take place with in the in_heritance. it is not
possiable with in the class.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What asp.net control can embed xaml into asp.net pages?

538


Can a master page have more than one contentplaceholder?

506


Why mvc is faster than asp.net? : Asp.Net MVC

528


calling result set one procedure to anothar procedure in sql2000

1336


What is globalization and localization in asp net?

489






What is difference between viewstate and session in asp net?

559


Differentiate strong typing and weak typing

524


What is a postback in asp net?

531


Explain the difference between server.transfer and response.redirect? Why would I choose one over the other?

539


1.What r collections? 2.What is .pdb file? 3.Is it possible to provide access to users in master page? 4.What is dirty n Phantom Read(SQL)? 5.What r different isolation levels(SQL)? 6.How to set authentication mode in web.config file?

1778


Where would you use an ihttpmodule, and what are the limitations of any?

547


What is the difference between response.redirect and server.transfer?

530


What is Web API Routing?

602


What is postback pixel?

519


What are session state modes in asp.net?

548