Ctrl K
Java · Junior · Theory

What's the difference between an abstract class and an interface, and when do you use each?

~4 min by voice

How to approach it

This checks whether you understand not only the syntactic differences (fields, constructors, multiple implementation, default methods) but also the meaning: an interface is a contract or capability, an abstract class is a common base with state. And whether you can choose between them deliberately.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsGive me an example from your own work where code violated one of the SOLID principles, and tell me how you fixed it. Mid-levelTell me about the SOLID principles. Can you give an example for at least a couple of them? JuniorYour team is writing an internal Java library that twenty other teams will use. How would you design its API so it can evolve without breaking clients? SeniorTell me how class inheritance works in Python. What does super() do? Junior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~4 min