• Post Reply Bookmark Topic Watch Topic
  • New Topic

first steps!!

 
ranjan andrews
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello!! i am unable to display an array of objects,what i do have displayed are the memory location references contained the array.i tried the toString() method,but had the same result.i would appreciate some inputs on this thanks!!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65666
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What types of objects are in the array? Unless the objects have defined meaningful toString() methods, the default is to generate a unique string usually including a memory reference.
hth,
bear
 
Francis Siu
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ranjan
i am unable to display an array of objects,what i do have displayed are the memory location references contained the array.i tried the toString() method
On every object instance,toString() method should be overrided in the object class which you define,so that it can display the meaningful information which you want to display.
In which you define the object class do the following to override the default one

HTH
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!