Return more than one value from a function in Java

后端 未结 6 1365
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-18 04:31

How to return more than one value from a function in Java? Can anyone give sample code for doing this using tuples? I am not able to understand the concept of tuples.

<
6条回答
  •  醉梦人生
    2020-12-18 05:12

    You can't return more than one value.

    You can return Array,Collection if it satisfies your purpose.

    Note: It would be one value, reference to your Object[of array,collection] would be return.

提交回复
热议问题