January 2002
Intermediate to advanced
264 pages
8h 3m
English
java.lang.String
This class represents a scaled-down version of the J2SE
String object. The String
object holds a concatenation of characters in an immutable format.
The static valueOf() methods are used to convert
the value of a primitive data type into a String.
compareTo() performs a lexicographical comparison
between two strings. startsWith() and
endsWith() test whether the string begins or ends
with the specified characters. indexOf() and
lastIndexOf() specify the offset from the
beginning of the first or last occurrence of a string.
substring() creates a smaller string from the
specified character offsets. trim() removes white
spaces from both ends of the string.
public final classString{ // static methods public static StringvalueOf(boolean b); public static StringvalueOf(char c); public static StringvalueOf(char[] data); public static StringvalueOf(char[] data, int offset, int count); public static StringvalueOf(int i); public static StringvalueOf(long l); public static StringvalueOf(Object obj); // public constructors publicString(); publicString(String value); publicString(char[] value); publicString(char[] value, int offset, int count); publicString(byte[] bytes, int off, int len, String enc) throws java.io.UnsupportedEncodingException; publicString(byte[] bytes, String enc) throws java.io.UnsupportedEncodingException; publicString(byte[] bytes, int off, int len); publicString(byte[] bytes); publicString(StringBuffer buffer); // public instance ...
Read now
Unlock full access