since i cant figure out the right thing to do.. i will just have to ask how to use array, what is its purpose and some examples! thank you guys

Recommended Answers

All 3 Replies

read my post and the link in your other thread.
seriously, it's a very bad idea to continue creating new threads

From your other thread...

Are you at least familiar with arrays?

Here's a link from the API

well, you may want to check out this link. normally, I would direct you to the array tutorials on the Oracle site, but I seem to have trouble loading the page.
On this page, you'll see how to use arrays and how to work with the index.

Arrays are fixed size structures that are useful for quickly accessing data. You can think of them as a partitioned box where each partition is an index in the array; that is, each index can store one element of the type you declared the array for. An example would be:

int[] someIntegers = new int[5];
for(int i = 0; i < someIntegers.length; i++) {
	someIntegers[i] = i + 1;

This code will create an array (someIntegers) and fill it like this:
Which is hard to think about at first because arrays are offset by 1, so an element that you would normally think of as someIntegers[1] is actually accessed like someIntegers[0].

Checking the official tutorial may also help.

This is by no means a complete description, but a good place to start.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.