Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+17 votes

In the program for ch3 I was wondering if it possible to return more than one value in a single method call or if it is even necessary?

asked in CSC211_Winter2018 by (1 point)

1 Answer

+13 votes

In Java, you can only return one value from a method. However, later on you'll learn that you can create custom objects, and then return an object that contains multiple values inside of it.

(Side note: there are some other languages, like Python, which make it easier to return multiple values from a method.)

answered by (508 points)