aspose file tools*
The moose likes Java Micro Edition and the fly likes Arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Arrays" Watch "Arrays" New topic
Author

Arrays

Lawrence Buensalida
Ranch Hand

Joined: May 18, 2005
Posts: 38
How do I create and use arrays in j2me midp 2?
Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904
As you do in J2SE (and J2EE for that matter).

Do you wish to make an array of anything specific, or was this just a general question ?

/Svend Rost
Lawrence Buensalida
Ranch Hand

Joined: May 18, 2005
Posts: 38
Thanks for the tip, though I'm just starting to learn Java, what you said is going to be helpful. Actually, I'm planning on creating an array for a set of 5 randomized numbers and I don't know if J2ME is capable of doing it, moreover, I don't know how to create and implement.
Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904
Hi,

Yes, it's possible to make random numbers in J2ME.

It's pretty simple to make an array. The following is a small
program for J2SE, which prints the values in an integer array.

If you insert the above code in a file called arrayTest.java, and compile
it (write the following in the prompt: javac ArrayTest.java), and then
run it with: java ArrayTest


The following is a small article concerning Random numbers in Java.
If your new to computing, it might be "a bit to much".
More on Random numbers in J2ME

regards,

/Svend Rost
Lawrence Buensalida
Ranch Hand

Joined: May 18, 2005
Posts: 38
Alright! It worked in J2ME too. Thank you very much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Arrays