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

So, I am working on an Android application. I came across a class Color. I see that one of his methods is colorToHSV. Just from the name, I think it will return a floating point array (HSV). However, it returns void! It takes an array as a parameter! I assume that it will change the passed array. But why should this be done? Just return the array! I also see this pattern readBooleanArrayin Parcel.

Why does he announce such a method? Is this some kind of pattern?

+4
source share
1 answer

But why is this needed?

, .

Android, Android 5.0, ( ART Android 5.0+ ). , , , , .

+6

Source: https://habr.com/ru/post/1606150/


All Articles