Java String(byte[] ascii, int hibyte, int offset, int count) Constructor

Syntax

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

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

Example

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


/*from w w  w .jav  a2  s.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,1,3));
    
  }
}




















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable