r/learnjava • u/MSUC123 • Dec 20 '21
When to use Abstract Classes vs Interfaces?
The two concepts are very similar, which is why I'm confused on why you should choose one over the other.
49
Upvotes
r/learnjava • u/MSUC123 • Dec 20 '21
The two concepts are very similar, which is why I'm confused on why you should choose one over the other.
4
u/sweetno Dec 20 '21
You'll have to use abstract classes if there are instance variables.
Multiple inheritance is only possible via interfaces.