I have a List<User> userList need to convert to UserData[]
for(int i = 0; i < userList.size(); i++){
userData[i] = userList.get(i);
}
It always returns null though the list size is 1. can anyone help on this.
Collections can be converted to arrays:
UserData[] userArray = userList.toArray(new UserData[userList.size()])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With