arrays - Object[] inside Object[] Java returns memory address? -


trying access object[] inside initial object[] returns memory address i.e. system.out.println(object[1]);.

how return contents instead?

when call system.out.println on array (or other object matter), implicitly invoke tostring() method (assuming it's not null, of course). arrays implement in trivial manner, so, mentioned, address, not useful.

arrays.tostring should give more useful output:

system.out.println(arrays.tostring(objects[1]));  

or better yet, use arrays.deeptostring print entire "parent" array:

system.out.println(arrays.deeptostring(objects));  

Comments

Popular posts from this blog

android - Hide only the Action bar on Scroll not action bar tabs -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -