java - Conventions regarding the return type for add() methods -
what java programming convention add(...)
methods? example:
treeset
:public void add(...)
biginteger
:public biginteger add(...)
why treeset
return type void, while biginteger
return type biginteger
?
when should use void in own methods?
if add
operation immutable, should return value (this case of biginteger
). else should return void
(the case of collection
, example, treeset
).
Comments
Post a Comment