Is there any way to define a variable or an attribute as read-only without defining a getter function/method for it?

Thoughts behind this question are:
1. For every reading, another function call process for CPU while it could directly read the value from memory.

2. Repetition of same name for variable and getVariableName. (Some might not agree with this but I like the code when it looks nice.)

Reply via email to