CAN interface have static methods in Java?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Studied at the University of Zurich, Lives in Zurich, Switzerland.
In Java 8, interfaces can contain implemented methods, static methods, and the so-called "default" methods (which the implementing classes do not need to override). ... static methods do not belong to interfaces. They belong to utility classes. "default" methods shouldn't have been allowed in interfaces at all.Mar 21, 2014
2023-06-13 06:34:29
评论(499)
Helpful(122)
Helpful
Helpful(2)

Isabella Parker
QuesHub.com delivers expert answers and knowledge to you.
In Java 8, interfaces can contain implemented methods, static methods, and the so-called "default" methods (which the implementing classes do not need to override). ... static methods do not belong to interfaces. They belong to utility classes. "default" methods shouldn't have been allowed in interfaces at all.Mar 21, 2014