Export (0) Print
Expand All

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
*/

Community Additions

ADD
Show:
© 2014 Microsoft