Science, asked by sujeetkumar5980, 1 year ago

What is a Default Method? Why do we need Default methods in Java 8 Interfaces?

Answers

Answered by soham3556
0
A default method cannot override a method from java.lang.Object . The reasoning is very simple, it's because Object is the base class for all the java classes. So even if we have Object class methods defined as default methods in interfaces, it will be useless because Object class method will always be used.
Similar questions