In some scenario, we may need to convert an array to a list or vice versa. We can use asList() method available in the Arrays class, and the toArray() method in List and set classes serve this purpose.
The Arrays.asList() method converts an array into a list and the size of the list is fixed.
The toArray() method converts a set or list to an array. This method has two forms of invocation. One form of the toArray() method returns a Object array, and another form returns the array of the type that is passed as the argument.
Welcome to Java Junction. Java junction talks about latest Java & related Web Technology.
Subscribe to:
Post Comments (Atom)
ORM Framework for Kotlin
In Kotlin, ORM (Object-Relational Mapping) libraries provide a convenient way to interact with databases using object-oriented programming p...
-
Feature Comparison Feature Liferay(5.1+) JBoss Portal(2.7) Out of the box Tools Has rich set of out of the box portlets Not too muc...
-
OSGi technology is Universal Middleware. OSGi technology provides a service-oriented, component-based environment for developers and offers...
No comments:
Post a Comment