Taking into account JIT and non-JIT devices, what would be most
efficient on Android for returning multiple values from functions:

an array like this:

float[] bestSize(float [] result) {

  // calculations...

  result[0] = width;
  result[1] = height;
  return result;
}

or a final class like this:

Size bestSize(Size result) {

  // calculations...

  result.width = width;
  result.height = height;
  return result;
}

Where Size is defined as:

public final class Size {
  public float width;
  public float height;
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to