Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Difference between abstract class and interface

Answer Posted / cinda

1)abstact class may or may not include abstract methods(An
abstract method is a method that is declared without an
implementation )
Bt interface is a class with only signature of a
methods.class that implements an interface must implement
all of the interface's methods.

example for abstract class:-
public abstract class x {
int x,y;//definitions
void draw(){}//non abstract methods
abstract void YY();//abstract methods
}

example for interface:-
interface x
{
void sample(int y);//signature of amethod
}

2)abstract class can inherit from only one class(it doesnt
support multiple inheritance)

public abstract class x {
int x,y;//definitions
void draw(){}//non abstract methods
abstract void YY();//abstract methods
}
class y extends x{
void draw(){
....
}
but interface supports multiple inheritance

Interface interface1{
.....
}

Interface interface2{
.....
}

Interface interface3{
.....
}
public Interface x extends interface1,interface2,interface3{

}

In Interfaces , it was noted that a class that implements
an interface must implement all of the interface's methods.
It is possible, however, to define a class that does not
implement all of the interface methods, provided that the
class is declared to be abstract. For example,
abstract class X implements Y {
// implements all but one method of Y
}

class XX extends X {
// implements the remaining method in Y
}

In this case, class X must be abstract because it does not
fully implement Y, but class XX does, in fact, implement Y.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about code access security?

989


if there are two application 1 and 2 having a variable x in both app if client1 changes value of x in 1 app client 2 want reads the value of x from 2 app what resultant value will he get

2311


difference between Response.write,server.transfer and also which one is used when ?

1914


Explain the race around condition? : .NET Architecture

1007


What is gui programming? : .NET Architecture

915


What are the main Tools to develop .Net Application?

956


What is the use of CLR in .NET?

1023


How to implement the display in the class printdoc (how to resolve the naming conflict) a: no naming conflicts

1058


What is the purpose of cache? How is it used? : Dot net architecture

878


What is the purpose of cache? : Dot net architecture

987


Explain 'managed' mean in the .NET context

1113


What is cookie less session?

1014


define cache memory? : Dot net architecture

972


any one can explain about projectarchitecture and project approach briefly

2500


Explain the types of memory management? : Dot net architecture

939