OK. Anyway thanks for the help, honestly couldn't do the rest of the code without it! :)
Type: Posts; User: IneedHelpwithJava
OK. Anyway thanks for the help, honestly couldn't do the rest of the code without it! :)
Sorry I usually understand examples a lot better. Could you show me an example?
Nothing really actually I just changed my code to args[count].length instead of sentence[count].length. I don't know what I was thinking having arrays with no value.
This sounds REALLY useful! How...
Yes you're right. Both my arrays have no Strings in them which is why they don't produce any result. How would I make a new array which uses the strings from (String []args) without being called args?
Hmm ok. I'll have a think and get back to you. Maybe change some things in my code. Thanks for the help.
--- Update ---
Hey right now I fixed my problem of the exception out of bounds (which is...
Oh I forgot, my array is "the dog isn't first second" I can change it to anything but thats what it is at the moment. The max length is therefore the longest word, which is 6 characters. 4
The error...
oh right.
int anArray[] = new int[max]; //This is just a value i determined earlier that calculated the max length of the array
int sum = 1;
int count = 0;
int i = 0;
String sentence[] =...
int anArray[] = new int[max]; //This is just a value i determined earlier that calculated the max length of the array
int sum = 1;
int count = 0;
int i = 0;
String sentence[] = new...
Basically my java program is supposed to calculate the length of each string in anArray. That isn't too much of problem HOWEVER I can't seem to figure out how to collect strings of the same length...