Wednesday 13 March 2013

valueOf(char[], int, int)


valueOf(char[], int, int)

Declaration:
public static java.lang.String valueOf(char[] data, int offset, int count)
Description:
Returns the string representation of a specific subarray of the char array argument.
The offset argument is the index of the first character of the subarray. The count argument specifies the
length of the subarray. The contents of the subarray are copied; subsequent modification of the character
array does not affect the newly created string.
Parameters:
data - the character array.
offset - the initial offset into the value of the String.
count - the length of the value of the String.
Returns: a newly allocated string representing the sequence of characters contained in the subarray of the
character array argument.
Throws:
NullPointerException - if data is null.
IndexOutOfBoundsException - if offset is negative, or count is negative, or
offset+count is larger than data.length.
valueOf(boolean)
Declaration:
public static java.lang.String valueOf(boolean b)
Description:
Returns the string representation of the boolean argument.
Parameters:
b - a boolean.
Returns: if the argument is true, a string equal to “true” is returned; otherwise, a string equal to
“false” is returned.
valueOf(char)
Declaration:
public static java.lang.String valueOf(char c)
Description:
Returns the string representation of the char argument.
Parameters:
c - a char.
Returns: a newly allocated string of length 1 containing as its single character the argument c.
valueOf(int)
Declaration:
public static java.lang.String valueOf(int i)

valueOf(long)

Description:
Returns the string representation of the int argument.
The representation is exactly the one returned by the Integer.toString method of one argument.
Parameters:
i - an int.
Returns: a newly allocated string containing a string representation of the int argument.
See Also: Integer.toString(int, int)
valueOf(long)
Declaration:
public static java.lang.String valueOf(long l)
Description:
Returns the string representation of the long argument.
The representation is exactly the one returned by the Long.toString method of one argument.
Parameters:
l - a long.
Returns: a newly allocated string containing a string representation of the long argument.
See Also: Long.toString(long)
valueOf(float)
Declaration:
public static java.lang.String valueOf(float f)
Description:
Returns the string representation of the float argument.
The representation is exactly the one returned by the Float.toString method of one argument.
Parameters:
f - a float.
Returns: a newly allocated string containing a string representation of the float argument.
Since: CLDC 1.1
See Also: Float.toString(float)
valueOf(double)
Declaration:
public static java.lang.String valueOf(double d)
Description:
Returns the string representation of the double argument.
The representation is exactly the one returned by the Double.toString method of one argument.
Parameters:
d - a double.
Returns: a newly allocated string containing a string representation of the double argument.
Since: CLDC 1.1

See Also: Double.toString(double)
intern()
Declaration:
public java.lang.String intern()
Description:
Returns a canonical representation for the string object.
A pool of strings, initially empty, is maintained privately by the class String.
When the intern method is invoked, if the pool already contains a string equal to this String object as
determined by the equals(Object) method, then the string from the pool is returned. Otherwise, this
String object is added to the pool and a reference to this String object is returned.
It follows that for any two strings s and t, s.intern() == t.intern() is true if and only if
s.equals(t) is true.
All literal strings and string-valued constant expressions are interned. String literals are defined in Section
3.10.5 of the Java Language Specification (http://java.sun.com/docs/books/jls/html/)
Returns: a string that has the same contents as this string, but is guaranteed to be from a pool of unique
strings.
Since: CLDC 1.1



No comments:

Post a Comment