The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Re: java array

Please read the forum rules, and post your question in the appropriate location. Your thread has been moved.

I recommend investing some time using resources at your disposal, rather than asking others to spend their valuable time doing this for you. One resource in particular: google java arrays If you have a more specific question that cannot be addressed after you've invested some time researching, then I encourage you to ask.

Re: java array

hey i believe an array is kind of like a list of a certain data type. for example
i will make an array of Strings

String list[] = {"one", "Two", "Three"};

here i have created an array call list.

I added three strings to the array "one" " two" and "three".

The [] means its an array of strings i will show you why.

typically there is more than one way to declare arrays so i will show you another way.

String list[] = new String();//this creates the array

list = new String[3]// this tells the compiler how many string are in your array "3"

list[0] = "one";// the first of the array starts at 0
list[1] = "two";//here we declare 3 strings and there index in the array list.
list[2] = "three";//if your not using strings you do not need the "quotation marks"

to use either array you would type

System.out.println(list[0]); // this will print the string at the index 0 aka "one"
System.out.println(list[1]); // this will print the string at the index 1 aka "two"
System.out.println(list[2]); // this will print the string at the index 2 aka "three"

Re: java array

simple spelling mistake does every moderator have to be so arrogant and well. it compiles for me so I believe it does instead of being so critical you could try help a person in a friendly manner instead of being so aggressive.

I am new to Java and new to this forum. so I am sharing what I have found works for me, I do not mind being corrected in-fact I would not be hear if I was not willing to listen and learn. I would just expect a little more understanding.

I made a mistake I put "i" instead of "is" not big deal but you say it as if I spoke a different language I am
pretty sure although a mistake on my part, it would take you no more than two seconds to realise it is supposed to be is....

Re: java array

Originally Posted by .Swing

simple spelling mistake does every moderator have to be so arrogant and well. it compiles for me so I believe it does instead of being so critical you could try help a person in a friendly manner instead of being so aggressive.

Its a moderators duty (moderators who do this unpaid and in their spare time) to prevent confusion. Having been doing this for years, I have seen my fair share of confusion lead to people wasting time, questions not getting answered, people getting sidetracked, and worst of all learning incorrectly. Asking someone to write with proper grammar is not arrogance, nor is it critical - it's to prevent confusion. And writing it bluntly is not arrogance or criticism, its a side affect of the impersonal nature of forums such as this. I would like to hope members contributing here do not want their questions or responses to lead to confusion, and would take advice given to them in a respectful and understanding way.

Re: java array

I know the duty of a moderator I am just saying there is better ways of spending your time than correcting none code related spelling issues.
As you could tell I was not using text slang It was merely a single missing letter. pointing it out the way you did suggests arrogance.
I do appreciate you time and help, I was just stating your correction of a simple missing letter I the manner you did so was not needed.
from my single day on this forum I have found that moderators such as you seem to talk down to people asking questions, for example.

a new guy joins the forum and asks a question

i want to know arrays please be tell us

he is met with the response

Please read the forum rules, and post your question in the appropriate location. Your thread has been moved.

I recommend investing some time using resources at your disposal, rather than asking others to spend their valuable time doing this for you. One resource in particular: google java arrays If you have a more specific question that cannot be addressed after you've invested some time researching, then I encourage you to ask.

can you not see how this type of response to a simple question could make this person feel as if this forum is not going to help an simply just
pawn him off to another site or otherwise make him/her go elsewhere.

Re: java array

Originally Posted by .Swing

can you not see how this type of response to a simple question could make this person feel as if this forum is not going to help an simply just
pawn him off to another site or otherwise make him/her go elsewhere.

I am not going to itemize my reasons for the format of my response. Suffice it to say my time is valuable to me (and valuable to all the other people here (and elsewhere) asking questions) - so why should I spend my time reproducing what has been said (and said much better than I could say) elsewhere, and can be easily found with a little effort?

If you wish to discuss this further, then please take the discussion to its own topic, PM or conversation rather taking this thread completely off topic. I would rather not have to lock this thread because of it