| Author |
convert collections to string
|
ssasi kumar
Greenhorn
Joined: Feb 23, 2011
Posts: 21
|
|
hi everybody,
i have one doubt how to convert collections(ArrayList,List,vector) to string......
with regards,
sasikumar
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14669
|
|
|
Collections of what ? And how do you intend to separate each item ?
|
[My Blog]
All roads lead to JavaRanch
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12907
|
|
Just call toString() on the collection.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Anooj Narvekar
Greenhorn
Joined: Feb 08, 2011
Posts: 10
|
|
|
Collections override toString method. It internally calls toString of Objects its holding. So if the objects its holding has overriden toString as required, then collection.toString should be what you actually want.
|
 |
 |
|
|
subject: convert collections to string
|
|
|