Collection to Array Java

You have seen earlier how to convert an array into collection class. Now let us see the other way of converting collection to array with toArray() method. Method signature of toArray() method as defined in java.util.Collection interface. T[] toArray(T[] a): Returns an array with the elements of the collection. Following example on collection to array …

Collection to Array Java Read More »