S
S
Sotnik132015-03-30 17:23:12
Java
Sotnik13, 2015-03-30 17:23:12

Is there an analogue of "sharp" readonly in Java?

Actually the question is: Is there an analogue of the "sharp" readonly in Java? And if not, how will they dodge so that the field changes only during initialization (in the constructor) and then it would be possible to access the field as a field, and not pull out the value through the method.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lexans, 2015-03-30
@Sotnik13

The modifier final is analogous to readonly.
constants in java are usually declared as
Public static final NAME = value;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question