码迷,mamicode.com
首页 > 编程语言 > 详细

JAVA_Object类toString方法

时间:2015-04-20 22:36:04      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

file:///C:/Java/jdk-8u45-docs-all/docs/api/index.html

  • toString

    public String toString()
    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:

     getClass().getName() + ‘@‘ + Integer.toHexString(hashCode())
     
    Returns:
    a string representation of the object.

JAVA_Object类toString方法

标签:

原文地址:http://www.cnblogs.com/roger-h/p/4442711.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!