| |
You are here: Experts > Computing/Technology > Focus on Java > Java > Array assignment
Java - Array assignment
Expert: Artemus Harper - 10/28/2009
Question i am in a beginning level Programming class and we were assigned to basically, from my understanding, create a sort of array list, only using an Array. We have to create an array, then give the user the ability to add, append, prepend, insert, or remove an item from the Array, as well as be able to increase the capacity of the array. i got a little ways, but as soon as i started printing the array to make sure i was doing it right, it returned things like [I@4e0e90 when i would try to add the number 5. i can't figure out what to do!?
Answer The array classes don't have any special implementation of toString(), you can use: Arrays.toString(yourArray) instead of yourArray.toString() to get a better looking output. Or you can manually iterate though the array yourself and print out each element. (The Arrays class is in java.util package).
Add to this Answer Ask a Question
|
|