• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Passing Jave object arrays

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
What are your superhero powers? Go ahead and try them on this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic