Link to home
Start Free TrialLog in
Avatar of snajalm
snajalm

asked on

Very Strange Java Concatenation Behaviour!

I'm Trying to construct my URL using the following concatenation

String url = URL_BASE + host  + "/gimp/index.php?cmd=" + cmd + "&user=" + userName + "&password=" + password.toString();

However, I get a reference to an object instead of the password itself.  "The password is passed in using a char array".  I also used the concat method with no luck at all.

https://reports.company.com/gimp/index.php?cmd=gs&user=someuser&password=[C@19c6866d
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Char{}.toString() is not producting String, whereas if you use condtrictor new String(char[] ) you'll get String out of char[] array
Avatar of snajalm
snajalm

ASKER

That worked just fine so many thanks to you "for_yan" for accurate answer!