In Swing, the password field has a getPassword()
(returns char[]
) method instead of the usual getText()
(returns String
) method. 在Swing中,密碼字段具備getPassword()
(返回char[]
)方法,而不是一般的getText()
(返回String
)方法。 Similarly, I have come across a suggestion not to use String
to handle passwords. 一樣,我遇到了不使用String
處理密碼的建議。 安全
Why does String
pose a threat to security when it comes to passwords? 爲何在密碼方面String
會對安全構成威脅? It feels inconvenient to use char[]
. 使用char[]
感受很不方便。 spa