Why char array is favored over string for the storage of passwords?



Why char array is favored over string for the storage of passwords?..

Answer / Kristu Rai Toppo

"A char array is often favored over a String for storing passwords because a char array retains the characters as plain characters without any additional wrapping objects. This means that char arrays use less memory compared to Strings, and the password data is not subjected to automatic encodings or decodings like Strings are. However, it's important to remember that even though using char arrays may help in storing passwords securely, proper encryption techniques should still be applied to protect against unauthorized access."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

who can we create the object of a class? in how many ways we can create it (max 5)

2 Answers  


What are the advantages of java inner classes?

1 Answers  


What is bifunction in java?

1 Answers  


waht You know about thread programming?

1 Answers  


What is a default constructor and also define copy contrucyor?

1 Answers   Global Logic,


Is string is a data type in java?

1 Answers  


Is hashmap thread safe?

1 Answers  


Why do we need to override equals() and hascode() method of object class?

1 Answers   Cognizant,


Which is faster string or stringbuilder?

1 Answers  


What's the access scope of protected access specifier?

1 Answers  


Difference between Web-based applications,Client- Server applications and Distributed applications?

3 Answers   Infosys,


Explain creating threads by extending thread class ?

1 Answers  


Categories