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 javac used for?
Explain about object oriented programming and its features?
What are the methods used to implement for the key object in the hash map?
Can we assign null to double in java?
Describe method overriding
Explain the meaning of java applet.
What is the size of arraylist in java?
What is visibility mode?
Is an array a vector?
Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..
What one should take care of, while serializing the object?
What is the scope or life time of instance variables?
What is a module function?
What are the advantages of functions?
How many static init can you have?