Container to ease passing around a tuple of two objects. This object provides a sensible implementation of equals(), returning true if equals() is true on each of the contained objects.
private Pair<String, Integer> getPair(){
return new Pair<String, Integer>("hello", 123);
}
public void testPair() {
Pair<String, Integer> pair = getPair();
Log.e("scrat", pair.first);
Log.e("scrat", String.valueOf(pair.second));
}
参考
http://developer.android.com/reference/android/util/Pair.html