Bookmark Topic Watch Topic
  • New Topic

Retrieving values of an oject  RSS feed

 
nizar malaikah
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi, how do i retrieve values of an object ?



the object is initialized and i get no errors when entering values .. but when i try to print by calling getSoftware i get [Ldd1318398project4.Software;@257f6796

if i need to post more of my code please tell me and thank you

 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Report post to moderator
the getSoftware method returns an ARRAY. that's what the brackets mean on this line

public Software[] getSoftware(int index){


So whatever you return, it is actually more like a box with lots of things in it. So what - EXACTLY - do you want to happen when you print, considering you may have anywhere from zero to thousands of things in your Software array?
 
nizar malaikah
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Report post to moderator
fred rosenberger wrote:the getSoftware method returns an ARRAY. that's what the brackets mean on this line

public Software[] getSoftware(int index){


So whatever you return, it is actually more like a box with lots of things in it. So what - EXACTLY - do you want to happen when you print, considering you may have anywhere from zero to thousands of things in your Software array?



i want it to return the values the user entered (name and version)

this might explain more http://www.coderanch.com/t/637833/java/java/passing-object-parameter

I'm really thankful that you responded quickly
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
nizar malaikah wrote:
i want it to return the values the user entered (name and version)

this might explain more http://www.coderanch.com/t/637833/java/java/passing-object-parameter

I'm really thankful that you responded quickly


And it looks like this topic is a duplicate of the other one now... so, lets continue in the other topic.

Henry
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!