arrays are immutable, once they are created, their size can not be changed. If you want a collection that will change in size, use an ArrayList instead (or if you need sychronization, use a Vector). Jason
Kevin If you have to use arrays just iterate over the first array and every piece of valid data add to a new array and ignore the invalid elements. Then set the original array null. If you dont have use arrays then Jasons suggesttion of an ArrayList or Vector is your best bet. Dave
Kevin, i understood 3 things from your query: 1. Rather u want to trim spaces in strings elements of an array 2 : or u have eneterd just spaces and want to edit it. 3. there are spaces in between the string that u want to remove. for 1. u have to run a loop and trim every elemetnt with String.trim() method or for 2. u can re-enter the values for 3. run a loop and search for spaces in every element and replace them. ihope it's clear [This message has been edited by Marilyn deQueiroz (edited November 03, 2001).]
Joined: Oct 16, 2001
I'm sorry i don't know how this smily came, i didn't wanted to add it
Read ALOT. Practice coding ALOT. Take bunches of Mock exams. Go through the JavaRanch forums ALOT. Three months you say. hmmmmm. Hope that Java is not your first object oriented language, and certainly not your first computer language. Check out The BunkHouse for reviews of lots of Java books. Especially the Beginner and Certification sections.
"JavaRanch, where the deer and the Certified play" - David O'Meara