java.lang.Object.toString()
This documentation is archived and is not being maintained.

java.lang.Object.toString()

Visual Studio 2005

Displays a human-readable representation of an Object.


public String toString()

A human-readable representation of an Object.

// object_tostring.jsl

public class MyObject extends Object
{
    public static void main(String[] args)
    {
        // Create a new instance of MyObject.
        MyObject obj = new MyObject();

        // Print out the string representation for obj.
        System.out.println("The string representation for obj is " +
            obj.toString());
    }
}

/*
Sample Output:
The string representation for obj is MyObject@33c0d9d
*/
Show:
© 2016 Microsoft