I have stored password in char array and while retriving them back I am calling String.ValueOf(char[] array)
method directly . Do this thing will store the formed String in String pool. If yes, How can we store hardcoded passwords more securely without the use of Hashing and encryption techniques?
Example:
public class TestUser {
public static void main(String[] args)
{
User u1 = new User();
System.out.println("User Name is "+u1.getUserId());
System.out.println("Password is "+String.valueOf(u1.getPassword()));
}
}
Please explain.