
Signature
And loving it,
qu0ll
______________________________________________
qu0llSixFour@gmail.com
(Replace the "SixFour" with numbers to email)
Simple.
When you pass foo only you are invoking println(char[]) method of the
PrintStream class (of which System.out is an instance) which prints
array of characters and terminates the line. When you pass "Output: "
+ foo , you are invoking println(String ) method of PrintStream class
which prints the string and terminates the line.
Your desired result can be achieved by issuing the following :
System.out.print("Output: "); System.out.println(foo);
Thank you
Muggle
> I am a little confused by the following program:
>
[quoted text clipped - 23 lines]
> qu0llSixF...@gmail.com
> (Replace the "SixFour" with numbers to email)
qu0ll - 30 Jan 2007 03:30 GMT
> Simple.
>
[quoted text clipped - 9 lines]
> Thank you
> Muggle
Thanks Muggle, that does the trick. I should have thought of that.

Signature
And loving it,
qu0ll
______________________________________________
qu0llSixFour@gmail.com
(Replace the "SixFour" with numbers to email)
Proton Projects - Moin - 30 Jan 2007 04:11 GMT
> > I am a little confused by the following program:
>
[quoted text clipped - 3 lines]
> > System.out.println(foo);
> > System.out.println("Output: " + foo);
API exist, that takes the input char[] and which internally run an
loop and calls the System.out.print version to print the char.
> > System.out.println("Output: " + foo.toString());
Here the case: foo is an array object...when u call a toString method
on an Object, it will try to print the Object itself..Object format is
like type of Object appended by the hex format of memory address.
to cross check usethe System.identityHashCode on foo..this will return
the same int of the same address and then convert the int value to hex
decimal to display the same memory location
> > }
>
[quoted text clipped - 15 lines]
> > qu0llSixF...@gmail.com
> > (Replace the "SixFour" with numbers to email)
Hope this will help u understand the difference between the two
printlns