dimanche 6 septembre 2015

Why are some methods in the Android SDK accept an array as a parameter instead of returning an array?

So I am working on an android app. I came across the Color class. I see that one of its methods is colorToHSV. Just from the name, I think it would return a float array (HSV). However, it returns void! It accepts an array as a parameter! I assume that it would modify the array passed in. But why does it have to do this? Just return an array! I also see this pattern in readBooleanArray in Parcel.

Why it declares the method like this? Is this some kind of pattern?

Aucun commentaire:

Enregistrer un commentaire