java中toString方法

简而言之:就是返回一个字符串对象,显示的格式为这样子:

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

 

 所以在实体类中我们都会重写toString()方法,可以显示一些有意义的东西,例如

 

 下面这篇有更详细的介绍

 

 https://blog.csdn.net/ITBigGod/article/details/79290332

posted @ 2020-07-25 11:59  zmlgoes  阅读(929)  评论(0)    收藏  举报