Java 8 thêm:
- default methods: concrete implementation trong interface, giúp backward compatibility khi thêm method mới mà không break implementation có sẵn. Cú pháp:
default void method() {...} - static methods: utility functions gọi qua
InterfaceName.method()
Lợi ích: mở rộng interface mà không phá vỡ code cũ.
Nhược điểm: vi phạm tính thuần túy của interface (logic trong interface). Dùng default method một cách thận trọng; ưu tiên abstract class cho shared implementation.