Accessors Methods [duplicate]

  accessor, c++, java

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?

Source: Windows Questions C++

LEAVE A COMMENT