Difference between Interface & Abstract class?
Answers were Sorted based on User's Feedback
Answer / ravikiran(aptech mumbai)
Interface is purely abstract.all the methods declared inside
the interfaqce are by default abstract and public.
where as an abstract class can have abstarct as well as non
abstact methods.
And an abstract class may heve no abstract methods at all.
we will do like this to restrict the creation of instance
ofthat particular class.
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / abnish kumar rajput
Abstract class is a class with may having abstract methods
or not.Whereas Interface supports multiple inheritences of
classes note that java does not directly support this concept.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / janet
1.All the methods declared inside an interface are abstract
where as abstract class must have atleast one abstract
method and others may be concrete or abstract.
2.In abstract class ,keyword abstract must be used for the
methods where as interface we need not use that keyword for
the methods.
3. Abstract class must have subclass where as interface
can't have subclasses.
Is This Answer Correct ? | 3 Yes | 3 No |
Answer / anjani kumar jha
Interface means 100% abstracness............
Abstract class means may be 100% abstracness............
There r lots of difference b/w but 2 major difference is
1)Abstract class is Tightly coupled with class and
interface is loosely coupled.
2)Interface is used to support multiple inheritance in
java...think hard.......
Thanks and Regards
Anjani Kumar Jha
9623154095
Is This Answer Correct ? | 1 Yes | 3 No |
Which is bigger double or float?
Can a static block throw exception?
What is the need to implement Serializable interface (with no methods) for objects which are to be serialized ? We can write our own functionality which writes objects to streams then why we need to implement and tell JVM that which objects can be serialized.
What is more advisable to create a thread, by implementing a Runnable interface or by extending Thread class?
How do you create a sop?
Explain about transient variables in java?
what is the difference between object and class
What is the size of int?
Differences between external iteration and internal iteration?
What does it mean that a class or member is final?
How to print nodes of a Binary tree?
What is a variable in java?