+ 1
Why are all fields in an interface static and final?
1 Réponse
+ 15
First: Try to understand what an interface is and what it is intended to do. Hope this can help you:
https://docs.oracle.com/javase/tutorial/java/IandI/createinterface.html
To answer your questions:
Static because you are not allowed to create an object of an interface, you can only implement or extend interfaces.
Final because you don't want the fields used in an interface to be changed.