what is the difference between abstract class and
Interface?where we can use it in realtime projects?
Answer Posted / abilash
1)If we r having 2 classes, both classes need a method with
same business logic(definition). Then we can go for an
abstract class. In this abstract class we can define the
method with functionality. And the two classes will extend
this abstract class.
2)In other case if two different classes wants two different
functionalities with same method name , then we go for an
interface with abstract declaration of method.And the two
classes will implement the interface and override the method
with different business logic
| Is This Answer Correct ? | 31 Yes | 12 No |
Post New Answer View All Answers
What is nested class?
How do you reverse a string in java?
What is the purpose of methodology?
How many wrapper classes are there in java?
What is string [] java?
what r advatages of websphere? & how to deploy?
What is empty list in java?
What checkbox method allows you to tell if a checkbox is checked?
What is arrays fill in java?
Explain super keyword in java.
What is difference between wait and notify in java?
What is the purpose of the return statement?
Can we have multiple classes in a single file?
Difference between string, string builder, and string buffer?
Difference between a class and an object?