June 2018
Beginner
722 pages
18h 47m
English
If a keyword final is placed in front of a variable declaration, the value of this variable once assigned (the variable is initialized) cannot be changed. The way a variable can be initialized depends on how the variable is used. There are three kinds of variable usage, and each has different initialization rules:
class SomeClass{ private String someValue = "Initial value"; public void setSomeValue(String someValue) { this.someValue = someValue; } public String getSomeValue() { return someValue; } } public class FinalDemo ...
Read now
Unlock full access