Anton Suprun

Jul 6, 2021

4 min read

Java: Interfaces

Read this to ace every interview question regarding interfaces.

Photo by Killian Cartignies on Unsplash

What are interfaces?

An interface is a reference type similar to a class but different in a sense that it can only contain abstract methods, default methods, static methods, (only default and static methods in interfaces can have a method body) nested types and constants. Interfaces cannot be instantiated; hence they do not have constructors…