how to convert char array to string
807591Jun 4 2008 — edited Jun 4 2008sirs,
i have written a method in java which will return a randomly generated string of a fixed length. i am creating one one character and inserting it into char array.
at last i am converting it to string
like this
String newpass= pass.toString();// pass is a char array
but problem is that the string is having different value what i hav generated.
if i am doing like this..
String newpass= new String(pass);// pass is a char array
here newpass is having correct value but having some error
error in the sense when i print
System.out.println(newpass+"some text");
"some text" is not printing
can you suggest the better way