Return multiple values from a Java method: why no n-tuple objects?

前端 未结 6 1735
故里飘歌
故里飘歌 2020-11-28 08:36

Why isn\'t there a (standard, Java certified) solution, as part of the Java language itself, to return multiple values from a Java method, rather than developers having to u

6条回答
  •  无人及你
    2020-11-28 08:57

    Java methods return exactly zero or one value; that is the standard for java. If you need multiple values returned, create an object with the multiple values and return it.

提交回复
热议问题