How to convert String to byte array and vice versa?
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers

 Q1. How to convert String to byte array and vice versa?Core Java
Ans. We can use String getBytes() method to convert String to byte array and we can use String constructor new String(byte[] arr) to convert byte array to String.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   string class   string


Related Questions

  Why is String immutable in Java ?
  Explain the scenerios to choose between String , StringBuilder and StringBuffer ?

or

What is the difference between String , StringBuilder and StringBuffer ?
  Why Char array is preferred over String for storing password?
  What are different ways to create String Object? Explain.
  What is a String Pool ?
  Which String class does not override the equals() and hashCode() methods, inheriting them directly from class Object?
  What is the difference between StringBuffer and String class ?
  What is an immutable class ?
  Difference between StringBuffer and StringBuilder ?
  What does String intern() method do?



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: