when,where and how to use abstract class and interface
Answer Posted / prapanch
if the developer wants some methods which are implemented
in the super class and some methods which will be
implementd by him then he will go for abstract class.
because in abstact class all methods need not to be abstact
in nature. but in interface all the methods must be
abstract and so the developer will not get any implemented
code from the interface. you will use interfaces when two
different teams are working for a same requirement then an
interface will act like a medium with which they can
interact and all the teams will be in line.so your team and
other team will implement the same method names but with
difffeerent implementation code.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Where are local variables stored?
Why enumeration is faster than iterator?
What is a JAR file?
What is parsing in grammar?
How to create a custom exception?
Explain the difference between private, public, package and protected in java?
Can two objects have same hashcode?
What is data object example?
Why use string handling in Java?
What is keyword and identifier?
What are the two parts of a conditional statement?
Explain the overview of UDP messaging.
What is stack class in java?
Can you write a java class that could be used both as an applet as well as an application?
What is the default size of set in java?