How to convert varargs to an array?
Varargs can be seen as a simplification of array when we need to pass a multiple value as a method parameter. Varargs it self is an array that automatically created, for these reason you will be enable to do things you can do with array to varargs.
In the example below you can see the messages parameter can be assigned to the String array variables, we can call the length method to the messages parameter as we do with the array. So actually you don't have to convert varargs to array because the varargs is an array.