Learn Java Programming - Interface Variables (Fields) Tutorial Java 8+

Publié le: 19 août 2015
sur la chaîne: Daniel Ross
3,664
32

An interface may contain a very specific type of a variable. When a variable (field) is declared in an interface it essentially becomes an implicitly declared constant. Here are the rules that apply to a variable in an interface:
Interface variables must be initialized when they are declared.
Interface variable values cannot be changed after they are declared.
The only modifiers that can be explicitly applied to an interface variable are: public, static, or final.
All interface variables are implicity marked public, static, and final.
Don't be fooled by what appears to be Default (Package-Private) access, public is the only access modifier allowed and implicitly required.


Sur cette page du site, vous pouvez voir la vidéo en ligne Learn Java Programming - Interface Variables (Fields) Tutorial Java 8+ durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Daniel Ross 19 août 2015, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 3,664 fois et il a aimé 32 téléspectateurs. Bon visionnage!