Share via


String.valueOf

Class Overview | Class Members | This Package | All Packages

Syntax 1

public static String valueOf( boolean b )

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.

Description

Returns the string representation of the boolean argument.

Syntax 2

public static String valueOf( char c )

Parameters
  • c
    a char.
Returns

a newly allocated string of length 1 containing as its single character the argument c.

Description

Returns the string representation of the char * argument.

Syntax 3

public static String valueOf( int i )

Parameters
  • i
    an int.
Returns

a newly allocated string containing a string representation of the int argument.

Description

Returns the string representation of the int argument.

The representation is exactly the one returned by the Integer.toString method of one argument.

See Also

toString

Syntax 4

public static String valueOf( long l )

Parameters
  • l
    a long.
Returns

a newly allocated string containing a string representation of the long argument.

Description

Returns the string representation of the long argument.

The representation is exactly the one returned by the Long.toString method of one argument.

See Also

toString

Syntax 5

public static String valueOf( float f )

Parameters
  • f
    a float.
Returns

a newly allocated string containing a string representation of the float argument.

Description

Returns the string representation of the float argument.

The representation is exactly the one returned by the Float.toString method of one argument.

See Also

toString

Syntax 6

public static String valueOf( double d )

Parameters
  • d
    a double.
Returns

a newly allocated string containing a string representation of the double argument.

Description

Returns the string representation of the double argument.

The representation is exactly the one returned by the Double.toString method of one argument.

See Also

toString