I am developing an Android project in which I need to return multiple List objects from a method. Is this possible?
For example, I have created two different List objects ….
List<String> tid_list=new ArrayList<String>();
List<String> tno_list=new ArrayList<String>();
and I want to return them from a method. How can I achieve this?
A function can, by definition, only return one value, so you’re left with a couple of options.
tid_listandtno_listas properties of itArrayListthat contains the twoArrayListstno_listandtid_listare properties of the class and the function is a method of the same class, you can edit them inside the method and completely skip the parameters/return value route.