Re: java Lists

  • From: "qubit" <lauraeaves@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Sat, 11 Dec 2010 17:33:31 -0600

Can you do the following? --
public static void main( String[] arg ) {
    ArrayList<String> alist = arg;
}
--le

----- Original Message ----- 
From: "Sina Bahram" <sbahram@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Saturday, December 11, 2010 4:55 PM
Subject: RE: java Lists


Yes but an ArrayList is a subclass that is atually useful, and obviously if 
something takes a list, it will by definition, take an
ArrayList.

Note: an ArrayList is most often preferable to a Vector

Byte[] bytes = New Byte[100];

Take care,
Sina

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx 
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of qubit
Sent: Saturday, December 11, 2010 5:50 PM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: java Lists

Hi Sina -- I am using a list because that is what the method I am using 
required.
However, now it compiles. But I am having trouble throwing together a test 
for my package.  How do I allocate a byte array of 100
elements?  I am still thinking c and feel like I am always a little lost 
climbing around the java docs.
Any enlightenment welcome. Thanks!
--le


----- Original Message -----
From: "Sina Bahram" <sbahram@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Saturday, December 11, 2010 12:21 PM
Subject: RE: java Lists


It's in java.util; however, I wouldn't just use List, but rather a more
specific concept.

Take care,
Sina
-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of qubit
Sent: Saturday, December 11, 2010 11:07 AM
To: bprogramming
Subject: java Lists

Greetings -- I am writing a java package that contains a method that has to
use class List<String>.  Unfortunately, I have gone
through a few screenfulls of docs, and although I find List under
Collections, I can't figure out what to import to get the
definition of List.
I spent yesterday and today battling with java docs and while I could
continue to look for this one, I am wondering if someone could
answer it off the top of their head.  I have tried  importing
java.Collections, java.lang.Collections, java.aut.List (that isn't the
right def).
Any info is welcome!
TIA
--le

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: