Being a strong typed language based on java processing doesnt allow multiple types in one array, there are alternatives though not as easily implemented as in a language such as javascript.
https://www.techiedelight.com/return-multiple-values-method-java/