Learn Java Programming - Final Reference Variables Tutorial

Publié le: 07 août 2015
sur la chaîne: Daniel Ross
1,107
15

When the final keyword is applied to a reference variable and the variable has been initialized, that reference variable cannot be reassigned to a different object instance. It is important to note that when final is applied to a reference variable it does not prevent the members of the object instance from changing values. A final reference variable can only be assigned to a reference of an object instance once and only once. The value does not need to be assigned when the reference variable is declared; this kind of a reference variable is called a blank final variable. A blank final instance reference variable must be assigned a value inside of a constructor or a compiler error will occur. A blank final local reference variable must be assigned a value before it is used. The optional common naming convention for final variables is to be in uppercase with an underscore (_) separating the words.


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