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
How many bits is size_t?
Difference between collection, collection and collections in java?
What is an object in java?
Is linkedlist thread safe in java?
What is a flag value?
What is binary search in java?
How many arguments can be passed to main ()?
What are 3 boolean operators?
What is a method in coding?
Why java uses the concept of the string literal?
What are the advantages and disadvantages of reference counting in garbage collection?
Define an enumeration?
What is the difference between a loader and a compiler?
Which methods are used during serialization and deserialization process?
What is increment in java?