In this section, you will learn to convert Collection data to an Array.
Code Description:
This program helps you in converting Collection data to an Array. Here we have taken an collection of weekdays which gets converted to Array using days.toArray method.
import java.util.*;
|
Output of the program:
| C:\unique>javac CollToArr.java C:\unique>java CollToArr Sunday Monday Tuesday Wednesday Thursday Friday Saturday C:\unique> |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Convert Collection to Array View All Comments
Post your Comment