It may seem a trivial question, but I’ve searched a lot and couldn’t find an answer.
If I have a final field like this:
private final double DEGREES;
The variabile is written in caps because it’s final, but shall also the getter method be in caps? So it would be getDEGREES or getDegress?
It should be
getDegrees. And, in my opinion, the only fields that should be in all caps are somestatic finalones. Member fields that are final do not need to be in all caps./edit
Indeed, Oracle’s Java code conventions say to only to have
static finalconstants in all caps, all member variables should be in lowerCamelCase.