Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #32907
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Ascii art issue JAVA |
| Date | 2015-10-20 11:59 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <n05o99$8nf$1@dont-email.me> (permalink) |
| References | <89196bf7-c590-472d-8791-6d501c2a7e8e@googlegroups.com> |
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
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