when to use abstract class and when to use interface?
Answer Posted / brijendra kumar soni(xavient)
1-By using Interface we can achieve the Multiple
inheritence while by using abstract class we can not
achieve.
2-Abstract Class extended by a class only while Interface
implmented by a class and extended to one or more
interfaces.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can an interface extend a class?
Can we have return statement in finally clause? What will happen?
Can we create an object of static class in java?
I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?
How to convert string to char and vice versa?
How do you check if a character in a string is a digit or letter?
Is alive in java?
Why char array is favored over string for the storage of passwords?
What is the default value of float and double datatype in java?
What is protected in java?
What are exception handling keywords in java?
What is set and get methods in java?
What is a values collection view ?
Can inner class be public in java?
What is the common usage of serialization? What exceptions occur during serialization?