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


why interfaces are faster than abstract classes?

Answers were Sorted based on User's Feedback



why interfaces are faster than abstract classes?..

Answer / aruna raman

Actually abstract are faster than interfaces classes.

interfaces are Slow, requires extra indirection to find the
corresponding method in the actual class. Modern JVM's are
discovering ways to reduce this speed penalty.

Abstract Class ::
- It cannot defines all the methods
- It has subclass.
- Here, Subclass is useless
- A class can be extend an abstract class

Interface ::
- It defines all the methods
- It must have implementations by other classes, But there
will be no use of that.
- Only an interface can extend another interface.

Is This Answer Correct ?    16 Yes 3 No

why interfaces are faster than abstract classes?..

Answer / laxmikant

As Interfaces always have abstract methods, it needs less
time for compiler to compile them as compared to abstract
classes which may have well defined methods for sharing
among the classes which will extend it.

Is This Answer Correct ?    4 Yes 16 No

why interfaces are faster than abstract classes?..

Answer / kalyan g

one more thing about interface is, we dont have any
implementations,so no burden of this, hence it is good in
performance

Is This Answer Correct ?    5 Yes 21 No

why interfaces are faster than abstract classes?..

Answer / m gangadhar

using interfaces over abstract classes is gives better
ferformance becoz interfaces does not have any constructor
but abstract classes can have. for this reason it does not
vaste time to create object.

Is This Answer Correct ?    11 Yes 29 No

Post New Answer

More Core Java Interview Questions

What is bool mean?

0 Answers  


How many days will it take to learn java?

0 Answers  


Is namespace same as package in java?

0 Answers  


What is the instance of an object?

0 Answers  


Why is java multithreaded?

0 Answers  


What is the use of join method?

0 Answers  


what is session facade ?

3 Answers  


Say any two properties in beans?

0 Answers  


What is a stream? what are the different types and classes of Streams?

2 Answers  


When we serialize an object does the serialization mechanism saves its references too?

0 Answers  


how to call one program .class file in another program

7 Answers   TCS,


what is the purpose of class "Object" which is base class for all classes?

3 Answers  


Categories