#How do I return two values from a method in java?

5 messages · Page 1 of 1 (latest)

oak path
#

Hello I'm new to java but is there a way I can return two values from a method in java so it can be used by another method, preferably without the use of an array.

gaunt stumpBOT
#

Hey, @oak path!
Please remember to /close this post once your question has been answered!

carmine oyster
#

Return an array return int[]{totalp,totalv};

#

Or create a class that store those