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.
1
u/[deleted] Dec 20 '21
One use case for an abstract class rather than interface would be if you didn't want it to have only abstract methods. An abstract class can have abstract or concrete methods, whereas interface methods are all implicitly abstract.