D
D
Denis Vasiliev2017-05-29 17:46:30
Java
Denis Vasiliev, 2017-05-29 17:46:30

Why is it possible to create an interface without overriding methods?

Language - Java, library - POI Apache, package - org.apache.poi.ss.usermodel.
Hello, please send a link with explanations why in this case it is possible to create an instance of the interface without overriding its methods (I tried to search in Google - I did not find it)
Sheet s = wb.createSheet(); Code example taken from poi.apache.org/spreadsheet/how-to.html#User+API+%2... , sixth line of code from
Sheet example as far as I understand interface: poi.apache.org/apidocs/org /apache/poi/ss/usermodel...
It turns out that I create an instance of the interface without overriding the method, however, as far as I knew up to this point, it is impossible and pointless to do this, because this is a class without an implementation.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
al_gon, 2017-05-29
@denmanorwat

https://github.com/apache/poi/blob/trunk/src/java/...
Line 814
You need to figure out how to use interfaces. The key word is "contract".
https://docs.oracle.com/javase/tutorial/java/IandI...
https://docs.oracle.com/javase/tutorial/displayCod...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question