Answer Posted / sumit sharma
Interface:-> JDK1.5 and above version provide a superb
functionality through interface. That is the main reason
behind using the interface is basically "Interface provide
the loose coupling and also support multiple inheritance".
This is a 100% abstract class. This is also support and
flexible with Polymorphism.
For Example:-
List<String> list = new ArrayList<String>();
Where as List is an interface while ArrayList is an class.
Abstract:-> Abstract class doesn't support multiple
inheritance and if you are creating an any abstract in any
ordinary classes then you must declare abstract. this is
also a major disadvantage of abstract class is that if you
are extend and class or abstract class then you can't extend
any one. Abstract class can't initialize only extended it.
Abstract class may have at least one or more abstract method.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is the difference between serializable and externalizable interfaces?
Can I import same package/class twice?
What are static variables and functions?
What does i ++ mean in Java?
How do you declare a string variable?
What do you mean by aggregation?
Can we declare array without size in java?
Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.
How use .contains in java?
What is an iterator interface in java programming?
Are true and false keywords?
What all access modifiers are allowed for top class ?
Can we have any code between try and finally blocks?
What is the difference between procedural and object-oriented programs?
What are the drawbacks for singleton class?