- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Interface enhancements in Java 8
Java 8 introduces a new concept of default method implementation in interfaces. This capability is added for backward compatibility so that old interfaces can be used to leverage the lambda expression capability of Java 8.
For example, ‘List’ or ‘Collection’ interfaces do not have ‘forEach’ method declaration. Thus, adding such method will simply break the collection framework implementations. Java 8 introduces default method so that List/Collection interface can have a default implementation of forEach method, and the class implementing these interfaces need not implement the same.
An interface can also have static helper methods from Java 8 onwards
- Related Articles
- What is Functional Interface in Java 8?
- What are the enhancements in Internationalization in Java 9?
- Difference between default and static interface method in Java 8.
- What are the main features and enhancements introduced in Java 9?
- Interface in Java
- What is Stringable Interface in PHP 8?
- ConcurrentMap Interface in java
- Deque interface in Java
- Externalizable Interface in Java
- Function interface in Java
- Nested interface in Java
- Marker interface in Java
- BinaryOperator Interface in Java
- IntUnaryOperator Interface in Java
- Why an interface cannot implement another interface in Java?

Advertisements