• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing Jave object arrays

 
Alexander Berry
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a little bit of code here and what it is attempting to do is read a file into a arraylist then return the array object to another method/Class for testing I am just using a method later it will e a class.

I can get the createObj code to work and but I have loss may way attempting to figure out how to get the readObj method to take the class and use the array.

The code is below any help would be greatly appreciated.

Thanks,

Alex.


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your method that reads should return a list, and the other method should take one. A list is an object, but an object isn't (necessarily) a list.
 
Alexander Berry
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't seem to get the arraylist method signature correct in readObj and I am not sure I have it correct in the return.

This is what I have so far:

 
Alexander Berry
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have it working between the two method now.

OK, OK, OK, I forgot the basics.

My next task is to get it working between classes via return. Until then I will consider this close I will repost if I have a problem.

Thanks for your help: Below is the code.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic