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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

excel vba - VBA Proxy auto-configuration for http requests -

sql server 2008 - split ssrs expression between 2 words -