0

I remember someone telling me that setting final whenever applicable is considered good practice in java. Everything not considered to change in any way.

For example:

private String final myProperty = "Hello World";

private String final myMethod() {
 return "Hello World";
}

Is there an equivalent? Should I use readonly whenever possible, as far as im aware its nearly identical to final. Not sure if its ok to use it in the same way though.

Asperger
  • 3,064
  • 8
  • 52
  • 100

0 Answers0