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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Char{}.toString() is not producting String, whereas if you use condtrictor new String(char[] ) you'll get String out of char[] array
ASKER
That worked just fine so many thanks to you "for_yan" for accurate answer!