AllExperts > Java 
Search      
Java
Volunteer
Answers to thousands of questions
 Home · More Java Questions · Answer Library  · Encyclopedia ·
More Java Answers
Question Library

Ask a question about Java
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Artemus Harper
Expertise
I have a BS in computer science and am working towards a Masters degree.

Experience
I have experience in Core Java, good background in Java swing/gui, some experience with JNI, Java reflection. knowledge of Java bytecode and annotations. Basics in c++ and c#

Education/Credentials
BS in Computer Science at Central Washington University

 
   

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


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.