Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Refactoring for Software Design Smells: Managing Technical Debt
this week in the
OO, Patterns, UML and Refactoring
convert collections to string
Joined: Feb 23, 2011
Feb 24, 2011 22:18:35
i have one doubt how to convert collections(
Joined: Nov 24, 2005
Feb 24, 2011 22:34:41
Collections of what ? And how do you intend to separate each item ?
All roads lead to JavaRanch
Jesper de Jong
Joined: Aug 16, 2005
Feb 25, 2011 00:36:30
on the collection.
List<Integer> list = new ArrayList<Integer>(); list.add(23); list.add(12); list.add(38); String text = list.toString(); System.out.println(text);
Java Beginners FAQ
JavaRanch SCJP FAQ
The Java Tutorial
Java SE 8 API documentation
Joined: Feb 08, 2011
Feb 25, 2011 05:07:24
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.
I agree. Here's the link:
subject: convert collections to string
how to subtract two strings
String array to arraylist
How to convert String to org.w3c.dom.Document
amount of digits entered(without a tokenizer)....
how to convert Byte to the String
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015