can u give one sinario when you use Abstract Class and When
you use Interface.
Answer Posted / dhawal
when u want behavior of interface then u can implement that
inteface with any other class and after instantiate that
class u can get behavior of that interfce because by default
methods in interface are abstract,
But in case of abstract class u can not create object of
abstract class means you can not instantiate abstact class
but after extending or by creating base class pointer ,using
dynamic method dispatch u can get behavior of abstract class
| Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?
What type of value does sizeof return?
how to prepare for IT Officers Interview in Banks
What is a singleton puppy?
Is 0 a prime number?
How do you end a program?
When should you use arraylist and when should you use linkedlist?
What is use of a abstract variable?
Explain about version control?
What is the purpose of the system class in java?
Which class is the superclass of all classes?
Explain different ways of creating a thread?
What are the main differences between notify and notifyAll in Java?
'A class is a template for an object' explain this statement.
What is java instanceof operator?