Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Re: ArrayList.t...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 11 Topic 15990 of 16204
Post > Topic >>

Re: ArrayList.toString versus iterating through the ArrayList

by Roedy Green <see_website@[EMAIL PROTECTED] > Apr 20, 2008 at 10:37 AM

On Sat, 19 Apr 2008 09:41:29 GMT, thufir <hawat.thufir@[EMAIL PROTECTED]
>
wrote, quoted or indirectly quoted someone who said :

>My understanding is that the toString method for an ArrayList will call 
>the respective toString method for each element of the ArrayList.

the Javadoc for the inherited ArrayList.toString method says:

Returns a string representation of this collection. The string
representation consists of a list of the collection's elements in the
order they are returned by its iterator, enclosed in square brackets
("[]"). Adjacent elements are separated by the characters ", " (comma
and space). Elements are converted to strings as by
String.valueOf(Object).

that is the equivalent of calling the overridden Object.toString
-- 

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 




 11 Posts in Topic:
ArrayList.toString versus iterating through the ArrayList
thufir <hawat.thufir@[  2008-04-19 09:41:29 
Re: ArrayList.toString versus iterating through the ArrayList
Hendrik Maryns <gtw37b  2008-04-19 12:18:54 
Re: ArrayList.toString versus iterating through the ArrayList
Lew <lew@[EMAIL PROTEC  2008-04-19 09:18:21 
Re: ArrayList.toString versus iterating through the ArrayList
thufir <hawat.thufir@[  2008-04-19 22:44:33 
Re: ArrayList.toString versus iterating through the ArrayList
Lew <lew@[EMAIL PROTEC  2008-04-19 22:52:07 
Re: ArrayList.toString versus iterating through the ArrayList
Roedy Green <see_websi  2008-04-20 10:37:38 
Re: ArrayList.toString versus iterating through the ArrayList
Roedy Green <see_websi  2008-04-20 10:39:47 
Re: ArrayList.toString versus iterating through the ArrayList
xinxin <jnzhouxinxin@[  2008-04-20 04:41:09 
Re: ArrayList.toString versus iterating through the ArrayList
Lew <lew@[EMAIL PROTEC  2008-04-20 09:36:58 
Re: ArrayList.toString versus iterating through the ArrayList
thufir <hawat.thufir@[  2008-04-20 20:36:09 
Re: ArrayList.toString versus iterating through the ArrayList
thufir <hawat.thufir@[  2008-04-20 20:38:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 6:36:05 CDT 2008.