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 -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -