java - Why are interface variables static and final by default? -


why interface variables static , final default in java?

from java interface design faq philip shaw:

interface variables static because java interfaces cannot instantiated in own right; value of variable must assigned in static context in no instance exists. final modifier ensures value assigned interface variable true constant cannot re-assigned program code.

source


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -