Udostępnij za pośrednictwem


Object.ToString Method

Definition

Returns a string representation of the object.

[Android.Runtime.Register("toString", "()Ljava/lang/String;", "GetToStringHandler")]
public override string ToString ();
[<Android.Runtime.Register("toString", "()Ljava/lang/String;", "GetToStringHandler")>]
override this.ToString : unit -> string

Returns

a string representation of the object.

Attributes

Remarks

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: <blockquote>

getClass().getName() + '@' + Integer.toHexString(hashCode())

</blockquote>

Java documentation for java.lang.Object.toString().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to