Why toString() returns an hexadecimal code?

2019-09-07 04:50发布

I have this written in my app

LastFmServer server = AndroidLastFmServerFactory.getServer();
Artist[] results;
results = server.searchForArtist("Hatebreed"); 
Log.e("", results[2].toString());

Why does this code make this appear in logcat?

fm.last.api.Artist@2bf03488

1条回答
Deceive 欺骗
2楼-- · 2019-09-07 05:35

It's because that class doesn't implement its own toString, so you end up calling the one inherited from java.lang.Object that gives you the class name and its hash.

查看更多
登录 后发表回答