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 the difference between abstract class and
Interface?where we can use it in realtime projects?

Answers were Sorted based on User's Feedback



what is the difference between abstract class and Interface?where we can use it in realtime project..

Answer / arvind

1.interface contains methods that must be abstract;
abstract class may contain concrete methods.
2.interface contains variables that must be static and
final; abstract class may contain non-final and final
variables.
3.members in an interface are public by default, abstract
class may contain non-public members.
4.interface is used to "implements"; whereas abstract class
is used to "extends".
5.interface can be used to achieve multiple inheritance;
abstract class can be used as a single inheritance.
6.interface can "extends" another interface, abstract class
can "extends" another class and "implements" multiple
interfaces.
7.interface is absolutely abstract; abstract class can be
invoked if a main() exists.
8.interface is more flexible than abstract class because
one class can only "extends" one super class,
but "implements" multiple interfaces.
9.If given a choice, use interface instead of abstract
class.

Is This Answer Correct ?    1 Yes 2 No

what is the difference between abstract class and Interface?where we can use it in realtime project..

Answer / rajesh

An abstract class must contain one abstract methiod while
in interface all method should be abstract.

Is This Answer Correct ?    0 Yes 2 No

what is the difference between abstract class and Interface?where we can use it in realtime project..

Answer / hanu

Both are same in many ways ..Except
if we extend that particular abstract class, we should be
implemented all those abstract methods in that class.
In the case of interface, we can implement any numbber of
methods to that interface ..

Is This Answer Correct ?    13 Yes 39 No

Post New Answer

More Core Java Interview Questions

What are the 3 types of loops in java?

0 Answers  


What do you mean by stack?

0 Answers   Accenture,


Explain different types of wrapper classes in java?

0 Answers  


Hi all, I am dng a mini project on FileSplitter application which splits the GBs of logfile into Smaller chunks(mbs) depending on the split size." How to handle GBs file? I am getting OutOfMemoryException, when I input such GB sized file. Thx

0 Answers  


Describe what a thread-local variable is in java?

0 Answers  


How will you print number in reverse (descending) order in BST.

0 Answers   GrapeCity,


solve (x-1)(x-9)=8;

3 Answers   IBM, Manhattan, TCS,


What is the use of singleton?

0 Answers  


What is map java?

0 Answers  


How many types of gc are there in java?

0 Answers  


I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

0 Answers  


Describe different states of a thread.

0 Answers  


Categories