[brailleblaster] Re: so Sina...

  • From: Chris von See <chris@xxxxxxxxxxxxx>
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Mon, 13 Dec 2010 17:13:00 -0800

Try using this:

public static void main(String[] args)
{
        List<String> = java.util.Arrays.toList(args);
}




On Dec 13, 2010, at 5:08 PM, qubit wrote:

I guess I'm missing something in your answer. On the one hand you say I can't initialize List<String> list with an array without a loop, (I can
handle that), but then you say

You can feed that array to various lists which will > take an array, and
then you'll have it as a list.

Are you saying that there is a feed method in class ArrayList that will take
the whole arg list array?
Or are you saying I can pass an ArrayList<String as an arg that takes an array, or args to something that takes an ArrayList<String>? (Obviously the
last does not work.)

The point is that I have a method in Process or ProcessBuilder (I don't remember which) that takes a List<String>, so I am naturally assuming that
that is easier to come by.

Oh, heck, I may just post the files without testing, but I figured it would
save someone else a little pain if I got them to work.

Anyone who wants to enlighten my misunderstanding of java please comment.
Thanx.
--le



----- Original Message -----
From: "Sina Bahram" <sbahram@xxxxxxxxx>
To: <brailleblaster@xxxxxxxxxxxxx>
Sent: Monday, December 13, 2010 5:07 PM
Subject: [brailleblaster] Re: so Sina...


You don't. it comes in as an array.

You can feed that array to various lists which will take an array, and then
you'll have it as a list.

Take care,
Sina

-----Original Message-----
From: brailleblaster-bounce@xxxxxxxxxxxxx
[mailto:brailleblaster-bounce@xxxxxxxxxxxxx] On Behalf Of qubit
Sent: Monday, December 13, 2010 5:56 PM
To: brailleblaster@xxxxxxxxxxxxx
Subject: [brailleblaster] so Sina...

If I can mix and match ByteArrays, what's wrong with this, and how do I get
a List<String> out of args without a loop?
And you think C++ is a tortuous pain...
--le






Other related posts: