Humty Humty - 1 year ago 72
Android Question

android.util.Pair<F, S> example in Android

I want to return a tuple of

data types. I am unable to create
. I have read the documentation but unable to make it.
I am doing as

private Pair myNums(double F, double S) {
Pair<F f, S s> p = Pair.create(F, S);
return p;

But it is saying

Unknown class F

Answer Source

F and S are the type. In your case is Double.

Pair<Double, Double> p = Pair.create(F, S);