In c++ we have accessor methods such as int get_value() const;
. If we try to change the state of object inside this method the compiler will throw an error. Has java such an alternative keyword to make sure that the state of object does not change?
Asked
Active
Viewed 22 times
1

Raza Taha
- 21
- 5
-
This question should not have the `c++` tag, since it is really entirely a `java` question that mentions C++. – Eljay May 30 '21 at 14:01