Concept
An interface declares what a type can do; an abstract class can also share state and partial implementation. Depend on interfaces in your signatures, and use abstract classes for shared machinery.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Interfaces and abstract classes doing its job.
public interface Notifier {
void send(String to, String message);
default void sendAll(List<String> to, String message) {
to.forEach(t -> send(t, message));
}
}
public abstract class RetryingNotifier implements Notifier {
protected abstract void attempt(String to, String message) throws IOException;
public void send(String to, String message) { /* retry around attempt() */ }
}Creating an interface with a single implementation "for flexibility" when nothing else will implement it. Add the interface when a second implementation, or a test double, needs it.
Your roadmap puts these before Interfaces and abstract classes, unless you already know them.
Once a session shows you understand Interfaces and abstract classes, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.
Topics that build on Interfaces and abstract classes.