You can return a class object in Java.
If you return more than one value that is related to each other, then it makes sense to encapsulate them in a class and then return an object of that class.
If you want to return unrelated values, you can use the built-in java container classes such as Map, List, Set, etc. Check out the java.util JavaDoc package for more details.
Aravind R. Yarram Dec 19 '11 at 6:10 2011-12-19 06:10
source share