Java Data Type Tutorial - Java String(byte[] ascii, int hibyte) Constructor








Syntax

String(byte[] ascii, int hibyte) constructor from String has the following syntax.

@Deprecated public String(byte[] ascii,     int hibyte)

Example

In the following code shows how to use String.String(byte[] ascii, int hibyte) constructor.

/*from w  w w.j  a v  a2s .  c o m*/


public class Main {
  public static void main(String[] argv) {
    byte[] bytes = new byte[]{65,66,67,68};
    System.out.println(new String(bytes,5));
    
  }
}

The code above generates the following result.