This documentation is archived and is not being maintained.

Integer.ToString Method ()

Visual Studio 2005

Returns the string representation of the value of an Integer object.

Package: java.lang

Assembly: vjslib (in vjslib.dll)


public java.lang.String toString();

The string representation of the value of the Integer object.

The following example converts the value of the constant Integer.MAX_VALUE to a string and displays the result.

// i-toString.jsl
// Integer toString example

public class MyClass
{
   public static void main(String[] args)
   {
      Integer i = new Integer(Integer.MAX_VALUE);

      System.out.println("The string is: " + i.toString());
      // or:
      // System.out.println("The string is: " + i);
   }
}

/*
Output:
The string is: 2147483647
*/

The method is implicitly included in the print and println methods.

Show: