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 do you stop a thread in java?
How does a for loop work?
what is heap memory?
What variables are stored in stack?
Can an interface extend another interface?
What is the size of int?
What is try-with-resources in java?
What are the two ways in which thread can be created?
what is the difference between future and callable interface in java?
Write a program in java to find the maximum and minimum value node from a circular linked list.
What is substring in java?
What is the use of keywords in java?
When arithmeticexception is thrown?
What is local variable and instance variable?
What is nan inf?