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

if i want to give an alert message like "try after sometime" to a web page which is being seen by other person.if a web page is not seen by anyone then it should display otherwise it show a display a message stating that other person is viewing so try after some time........how can i implement this.

1839


In a page I have gridview with options of select and delete using hyperlink when I am selecting any one of then it has to open another page how can it?

506


How to communicate via Remote proxy with Client? a)MarshalByRef b)Marshal by Value or Any thing else?

1571


How can you ensure a permanent cookie?

553


Distinguish between Server-side and Client-side code with its functionality?

626






What is bound controls

588


What is the default authentication mode for asp.net?

564


List down the sequence of methods called during the page load.

528


How could you modify xaml content from javascript?

515


Can I combine classic asp and asp.net pages?

532


What is the differences between a primary key and a unique key in sql server?

536


What is in a session cookie?

540


What is asp.net caching?

578


Can a .net web application consume java web service?

512


Differentiate between client-side and server-side validations in web pages.

559