After adding the default method in Java 1.8, does the interface remain completely abstract?

After adding the default method in Java 1.8, does the interface remain completely abstract?

I'm sorry if I can't state the problem clearly

Solution

Even if there is only one default method in your interface, it is abstract You must provide an implementation class to instantiate the object Note that the default method added in Java 8 has a special purpose Start with Java doc:

So you should use the default method wisely

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>