Both static methods and default methods were introduced in interfaces to enhance functionality without breaking existing implementations. However, they serve different purposes. A static method belongs to the interface itself, while a default method provides a reusable implementation that can be inherited and overridden by implementing classes.
Consider a Payment interface. A static method can validate payment details, while a default method can provide a common payment status message.
interface Payment {
static boolean isValidAmount(double amount) {
return amount > 0;
}
default void showStatus() {
System.out.println("Payment Processed");
}
}
class UpiPayment implements Payment {
@Override
public void showStatus() {
System.out.println("UPI Payment Processed");
}
}
public class Demo {
public static void main(String[] args) {
System.out.println(
Payment.isValidAmount(1000)
);
UpiPayment payment = new UpiPayment();
payment.showStatus();
}
}true
UPI Payment Processed
A concise interview answer is
A static method in an interface belongs to the interface itself and is called using the interface name. It cannot be overridden. A default method provides a concrete implementation that implementing classes inherit and may override if needed. Static methods are used for utility functions, while default methods provide shared behavior.
Last updated: 16 July 2026
Previous question: Explain the difference between Comparable and Comparator interfaces. When would you use one over the other?
Next question: What is the diamond problem in Java and how does Java address it?