Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32907

Re: Ascii art issue JAVA

Path csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Ascii art issue JAVA
Date Tue, 20 Oct 2015 11:59:35 -0400
Organization A noiseless patient Spider
Lines 25
Message-ID <n05o99$8nf$1@dont-email.me> (permalink)
References <89196bf7-c590-472d-8791-6d501c2a7e8e@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
Injection-Date Tue, 20 Oct 2015 15:57:29 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="858a9d65d95f4ea4d355bd116aa2cdbf"; logging-data="8943"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RkmQ7mRDzfSyFYE68Al7Q"
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
In-Reply-To <89196bf7-c590-472d-8791-6d501c2a7e8e@googlegroups.com>
Cancel-Lock sha1:mjoCeBLBgbY/e+l1kjdY14MJsak=
Xref csiph.com comp.lang.java.programmer:32907

Show key headers only | View raw


On 10/20/2015 11:31 AM, Stavros Argyrou wrote:
> So I wrote this, I want to create the shape of the Greek letter Φ, I changed this code a bit it worked with the char * but now I want to make it so it prints the row number instead of stars. I changed C as int to parse the row into my function. I get no errors but the result is something like [L]java.lang.String@58342342319423.. random numbers :S Thanks

     When you get a result you do not understand and you want to
ask for help about it, *never* say "the result is something like."
Say what the result actually *is* instead.  Otherwise, the people
who would like to help must guess at the nature of your trouble,
and may guess incorrectly.

     My guess:

>          String[] line = new String[right + 2];
>          [...]
>          return new String(line.toString());

     The final line produces a String representation of the array
object itself, not a concatenation of all the array elements.
You should make a StringBuilder, append the individual Strings to
it (in the correct order), and return its toString() instead.

     But I'm just guessing.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Ascii art issue JAVA Stavros Argyrou <stavris.47@gmail.com> - 2015-10-20 08:31 -0700
  Re: Ascii art issue JAVA Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-10-20 11:59 -0400

csiph-web