where u use Abstraction and Interface in real time
Answers were Sorted based on User's Feedback
Answer / praveen
If a user want to interact with my application he need an
interface. With the interface the user can access the
specific methods of a class that implemented the interface.
For example user want to call a method. He already know the
specific class implemented that interface, then he can call
the method through reference object.
Abstract class is used whenever a user restricted to
inheritance but not taking instance of a class or if any
methods are there that should be implement by the user.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / teja
When ever there is need of having same common features
among the subclasses of of super class we have to go for
AbstractClass,
When ever there is no common features for subclasses of
super class we have to go for interface
| Is This Answer Correct ? | 1 Yes | 0 No |
What do you understand by garbage collection in Java? Can it be forced to run?
Which is bigger float or double java?
How many types of operators are there?
What is the use of java?
Is the empty set a singleton?
In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?
What Is Composition?
Can a class have 2 constructors?
State one difference between a template class and class template.
What is the use of bufferedreader?
What is the purpose of format function?
When finally clause is executed?