Abbreviated form of Java getter/setter field methods -
im curious if there exists abbreviation form getter/setter methods of objects
simpleobject osimple = new simpleobject(); osimple.setcountervalue(osimple.getcountervalue() + 1);
like 1 simple datatypes
int counter = 0; counter += 2;
info
the getter/setter methods required.
addition
if there isn't language feature thats support idea, convenient way deal in context of , clean code?
as geert3 said there no shortcut setters/getters in java without accessing property directly.
in case simpleobject
-class should have method increasecounter()
, maybe increasecounterby(int add)
(or add(int a)
).
Comments
Post a Comment