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...


what is main difference b/w abstract class and interface

Answers were Sorted based on User's Feedback



what is main difference b/w abstract class and interface..

Answer / naga~1417

A class implementing an interface must implement all of the
methods defined in the interface, while a class extending
an abstract class need not implement any of the methods
defined in the abstract class. Additionally, a class
extending an abstract class can implement an infinite
number of it's own methods.

Abstract class does not support Multiple Inheritance .
Interface supports Multiple Inheriatnce..

The differnce is that in interface all are public but in
abstract class u can have private and protected members

Abstract class contains the method defination of the some
methods. but Interface contains only method declaration, no
defination

Is This Answer Correct ?    3 Yes 0 No

what is main difference b/w abstract class and interface..

Answer / bindu madhavi

Abstract class is a class which has both complete
incomplete methods.

Interface is which can have only unimplemeted methods.

Is This Answer Correct ?    2 Yes 0 No

what is main difference b/w abstract class and interface..

Answer / shikha sharma

1) Every method in interface class should be abstract, but
this is not necessary in abstract class.

2)abstract class is a class which must have at least one
abstract method.
interface is a class which having all abstract methods.By
default interface methods are public abstract.

Is This Answer Correct ?    2 Yes 0 No

what is main difference b/w abstract class and interface..

Answer / priyabrata patro

listen in fact, java supports three types of structure. And they are fully implemented structure , fully unimplemented structure and partially implemented and unimplemented structure .
Now what is abstract class?
abstract class is one type of structure where exactly you can find both implemented and unimplemented method.I mean to say here it is partially implemented and unimplemented structure.So , usage of this class is to allow subclass to fullfill his own requirement by overriding abstract method defined in abstract class.And if you want to know complete information about abstract class you can contact to me in this email id priyabrata.try@gmail.com.

Now what is interface ?
interface is fully unimplemented structure where only unimplemented methods can be found out.And purpose to use this interface is to achieve run time polymorphism .
Now you will tell me that(run time polymorphism) also can be achieved by abstract class . Obviously , you can but you can not create object of interface but you can create object of abstract class by subclass (if it is a class).

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Core Java Interview Questions

What are kinds of processors?

0 Answers  


Explain different ways of creating a thread. Which one would you prefer and why?

0 Answers  


explain the life cycle of thread?

10 Answers   CTS, NIIT, TCS,


"We cannot create an object of interface but we can create a variable of it". Discuss the statement with the help of an example. (Plz help us to provide immediately.)

3 Answers  


Can a main method be declared final?

0 Answers  


Explain the importance of import keyword in java?

0 Answers  


What is default size of arraylist in java?

0 Answers  


Which of the classes will have more memory allocated?

0 Answers  


Can we declare an interface as final?

0 Answers  


Can an unreachable object become reachable again?

3 Answers  


Is main a function?

0 Answers  


What is the difference between getCodeBase and getDocumentBase methods?

1 Answers   CS Business Services,


Categories