const-correctness is not a concept that exists in C#, so there's no way of reproducing the C++ behaviour. If it's the same for Java, then you can't help much.
I saw a workaround for C#, but I'm not sure if it's worth it. After all, why should we emulate something that doesn't exist in the language itself?