1. Download our Official Android App: Forums for Android!

Apps Return multiple varibles

Discussion in 'Android Development' started by KarneeKarnay, Mar 12, 2016.

  1. KarneeKarnay

    KarneeKarnay Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    24
    Joined:
    Dec 3, 2012

    Dec 3, 2012
    24
    0
    15
    Hi Guys,

    I a need to create two ArrayLists that contain different sets of information. Is it possible to return more than one variable or should I return a holder with both variables within it?
     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Recognized Developer
    Rank:
     #12
    Points:
    1,988
    Posts:
    9,176
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    9,176
    13,681
    1,988
    Male
    Software developer
    South West of England
    A method can only return one object or primitive value (int etc.)
    So as you say, the way to return multiple ArrayLists would be to use a 'holder' object.
     

Share This Page

Loading...