 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Seamoon Guest
|
Posted: Mon Mar 01, 2004 9:46 pm Post subject: Arrays in vector |
|
|
Hi,
I want to put arrays of bytes of different lengths in a vector, but if I got
it right only objects can be placed in a vector so how do I convert an array
to and from an object? Ie. if I were to put an atomic datatype like int in a
vector it could be done using the wrapperclass Integer, like v.addLast(new
Integer(64)). What's the corresponding action for arrays?
/Seamoon
|
|
| Back to top |
|
 |
Christophe Vanfleteren Guest
|
Posted: Mon Mar 01, 2004 9:57 pm Post subject: Re: Arrays in vector |
|
|
Seamoon wrote:
| Quote: | Hi,
I want to put arrays of bytes of different lengths in a vector, but if I
got it right only objects can be placed in a vector so how do I convert an
array to and from an object? Ie. if I were to put an atomic datatype like
int in a vector it could be done using the wrapperclass Integer, like
v.addLast(new Integer(64)). What's the corresponding action for arrays?
/Seamoon
|
Have you even tried to do what you want?
Hint: all arrays are Objects in java.
--
Kind regards,
Christophe Vanfleteren
|
|
| Back to top |
|
 |
Lloyd Guest
|
Posted: Wed Mar 03, 2004 12:31 am Post subject: Re: Arrays in vector |
|
|
"Seamoon" <ulfsbecker*remove*@swipnet.se> wrote
| Quote: | Hi,
I want to put arrays of bytes of different lengths in a vector, but if I
got
it right only objects can be placed in a vector so how do I convert an
array
to and from an object? Ie. if I were to put an atomic datatype like int in
a
vector it could be done using the wrapperclass Integer, like v.addLast(new
Integer(64)). What's the corresponding action for arrays?
|
An array _is_ an object.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|