Can an interface in Java contain static methods, and if so, how can they be used?

Yes, interfaces in Java can contain static methods. This feature was introduced in Java 8 to allow utility or helper methods to be placed directly inside an interface. Static methods belong to the interface itself and can be called without creating an object of the implementing class.

Key Points

Example

A Payment interface may contain a static utility method to validate a transaction amount before processing payments.

interface Payment {

    void pay(double amount);

    static boolean isValidAmount(double amount) {
        return amount > 0;
    }
}

class UpiPayment implements Payment {

    @Override
    public void pay(double amount) {
        System.out.println("Payment Successful");
    }
}

public class Demo {

    public static void main(String[] args) {

        boolean valid =
                Payment.isValidAmount(1000);

        System.out.println(valid);
    }
}

Output

true

Important Notes

Example

Payment.isValidAmount(1000);

Incorrect

Payment payment = new UpiPayment();

payment.isValidAmount(1000); // Compilation Error

Common Uses

Interview Tip

A concise interview answer is

Yes, interfaces can contain static methods since Java 8. These methods belong to the interface itself and are called using the interface name. They are commonly used for utility or helper functionality and cannot be overridden by implementing classes.

Last updated: 16 July 2026

Previous question: How do you use multiple inheritance in Java using interfaces?

Next question: When would you use an interface, and when would you use an abstract class?

More Core Java - Level II interview questions

All Core Java - Level II questions