+ 2
What happens when the variable has got first letter in capitals before using it with getters and setters?
While working with getters and setters we need to have the first letter in capitals. But if I have a variable, lets say : 'Axon', it's first letter is already in capitals. So will this be valid also within the code with getAxon()??
2 odpowiedzi
+ 3
YES! getter And setter is a concept. so it does not matter the naming style in as much as it obeys the rule for naming in Java. however following naming convention is highly recommended as it aides readability. getAxon() is correct following the naming convention but why name the variable Axon
0
If you follow the naming convention, your variable will have the name "axon" and not "Axon".