Why do we use getbytes in Java?
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. Why do we use getbytes in Java?Core Java
Ans. It is used to convert String into an array of bytes.

byte[] getBytes() - converts String into a byte array.

byte[] getBytes(Charset charset) - converts String to byte array, based on charset encoding.

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

   Like         Discuss         Correct / Improve     


Related Questions

  What is a stream and what are the types of Streams and classes of the Streams?
  How to convert String to byte array and vice versa?
  What is Java bytecode ?
  Which class is used to read streams of raw bytes from a file?
  Which is of the following is NOT TRUE for JVM ?
  Which is the default Input Formats defined in Hadoop ?
  Which of the following is not an input format in Hadoop ?
 Does Scala code compile to be Java Byte Code ?
 how to get most significant bit from a byte?



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: