Skip to main content

command line option arrayList in java

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2008-04-18

Want to take in a list of Array elements from a command line eg Prog1 arg1 arg2 ArrayList in java

Have the following
String arg1
String arg2;
List<String> arg3;
if(args.size() == 3) {
arg1 = args.get(0);
arg2= args.get(1);
arg3= args.get(2);
I want arg3 to contain the list of elements Anyy ideas how i can achieve this using the get.args()

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2010-08-05