Java String getBytes()


The java string getBytes() method returns the byte array of the string. In other words, it returns sequence of bytes.

Signature

There are 3 variant of getBytes() method. The signature or syntax of string getBytes() method is given below:

public byte[] getBytes()

public byte[] getBytes(Charset charset)

public byte[] getBytes(String charsetName)throws UnsupportedEncodingException



Returns

sequence of bytes.


Java String equals() method example

Flash soon



Copyright 2017 Design& Development