Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: markspace Newsgroups: comp.lang.java.programmer Subject: Re: Printing Out appended list Date: Thu, 21 Mar 2013 08:09:20 -0700 Organization: A noiseless patient Spider Lines: 16 Message-ID: References: <47637551-543f-49fc-8165-41de869e6a8f@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 21 Mar 2013 15:07:24 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="fba3415ba68d85d643935af2f52f0b4b"; logging-data="24419"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UhH+n9ufKxPv6Fycn0MHCfqH8URmYzfU=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 In-Reply-To: <47637551-543f-49fc-8165-41de869e6a8f@googlegroups.com> Cancel-Lock: sha1:WLhUAlPM0dBNkmCRyZ3KPtcdNuA= Xref: csiph.com comp.lang.java.programmer:23031 On 3/21/2013 7:59 AM, subhabangalore@gmail.com wrote: > Dear Group, > > If I try to append the strings in sb within a loop, where strings are > getting generated from loop, --this part is getting fine, but the > problem is how I can take out the print of the "sb" portion. > > for (loop condition) { StringBuilder sb = new StringBuilder(); > sb.append("some string"); . . . sb.append(anotherString); } > I don't understand what is being asked. What is "take out the print"? What does System.out.println( sb ); give you? What do you want different?