- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Why is char[] preferred over String for storing passwords?
Yes, Storing password in String object is not safe for following reasons −
String objects are immutable and until garbage collected, they remain in memory.
String being plain text can be tracked in memory dump of the application.
In log, String based password may be printed which can cause a problem.
Char[] can be cleared or wiped out after the job is done.
Advertisements