- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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.
- Why is IPv6 preferred over IPv4?
- Why is gold jewellery more preferred over silver jewellery?
- Why is a Dictionary preferred over a Hashtable in C#?
- What is Java Server Pages, JSP? Why JSP is preferred over CGI?
- Why is cow milk preferred over Buffalo milk by most fitness freaks?
- Why Char array is more secure (store sensitive data) than String in Java?
- Why did Facebook recently buy passwords off Black market?
- What is the preferred way to concatenate a string in Python?
- When can a double-type be preferred over float-type in Java?
- char vs string keywords in C#
- What is the cost of preferred stock?
- Why string is immutable in Java?
- Best data type for storing large strings in MySQL?
- Which MySQL Datatype should be used for storing BloodType?