Say I have a person object with properties such as name, hair color, and eye color. I have the following array Person[] people>
name
hair color
eye color
Person[] people>
java 8:
String[] names = Arrays.asStream(people).map(Person::getName).asArray(String[]::new);