General Motors (GM) Interview Question

why do you want to store critical data like password in a char array rather than String?

Interview Answer

Anonymous

Feb 27, 2015

Their reasoning was that since String is immutable, JVM might keep the string around longer and might compramize the security of that data. I did not think that was a valid enough argument. In fact, by not using string and using char array, we are introducing the JMM level automicity issues. But I did not really get their point of view on this