Is it possible to have default method definition in an interface without marking it with default keyword?

No, we have to always mark a default method in interface with default keyword.

If we create a method with implementation in an interface, but do not mark it as default, then we will get compile time error.

Read the full book at www.amazon.com
Posted in Java 8, Java 8 Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*