Difference between
Title
Question
what are the main difference between abstract class and interface?..
Java Abstract-Classes 04-05 min 30-40 sec
Answers:
An interface is like an abstract class which can only have:
1. static and final variables (constants)
2. abstract methods
from Java 8 onwards
3. statidc methods
4. default methods
from Java 9 onwards
5 private methods
and can participate in multiple inheritance,, unlike an abstract class.
Abstract is an constructor
Interference is not an constructor
{ Constructor : a block of code similar to a method that's called when an instance of an object is created .}
Login to add comment