String.String
Class Overview | Class Members |
This Package |
All Packages
public String()
Description
Allocates a new String containing no characters.
public String( String value )
Parameters
- value
- a String.
Description
Allocates a new string that contains the same sequence of
characters as the string argument.
public String( char value[] )
Parameters
- value
- the initial value of the string.
Description
Allocates a new String so that it represents the
sequence of characters currently contained in the character array
argument.
public String( char value[],
int offset,
int count )
Parameters
- value
- array that is the source of characters.
- offset
- the initial offset.
- count
- the length.
Description
Allocates a new String that contains characters from
a subarray of the character array argument. The offset
argument is the index of the first character of the subarray and
the count argument specifies the length of the
subarray.
Exceptions
StringIndexOutOfBoundsException
if the offset
and count arguments index characters outside
the bounds of the value array.
public String( byte ascii[],
int hibyte,
int offset,
int count )
Parameters
- ascii
- the bytes to be converted to characters.
- hibyte
- the top 8 bits of each 16-bit Unicode character.
- offset
- the initial offset.
- count
- the length.
Description
Note: String() is deprecated.
This method does not properly convert bytes into characters.
As of JDK 1.1, the preferred way to do this is via the
String constructors that take a character-encoding name or
that use the platform's default encoding.
Allocates a new String constructed from a subarray
of an array of 8-bit integer values.
The offset argument is the index of the first byte
of the subarray, and the count argument specifies the
length of the subarray.
Each byte in the subarray is converted to a
char as specified in the method above.
Exceptions
StringIndexOutOfBoundsException
if the offset
or count argument is invalid.
See Also
String, String, String, String, String
public String( byte ascii[],
int hibyte )
Parameters
- ascii
- the bytes to be converted to characters.
- hibyte
- the top 8 bits of each 16-bit Unicode character.
Description
Note: String() is deprecated.
This method does not properly convert bytes into characters.
As of JDK 1.1, the preferred way to do this is via the
String constructors that take a character-encoding name or
that use the platform's default encoding.
Allocates a new String containing characters
constructed from an array of 8-bit integer values. Each character
cin the resulting string is constructed from the
corresponding component b in the byte array such that: