• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how can I print out the value of this list without havig to change evrything to static?

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the code:



But up in the main method, print(); is underlined and the only way I can get rid of errors is by changing everything to static. How can I print the value of ids out without having to do this.?
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Create an instance?
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah so its that simple eh?

I just did



Now do I actually need the loadNodes() method in there like I have it (this method is the one that changes the value of ids) or do I just need the prin() method? I would think the former otherwise the values would never get changed, just the print method would be invoked which would return nothing at all right?

I would try myself but the web service that is the data source has been down all weekend so have been pretty restarined with what I can get done this weekend. Bad timing too, I have to have something to show by Wednesday...
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I favor a method called "print" not be making a web service call - that would be confusing. I think what you have is good.

In terms of testing, it's a good practice to create a "mock" for the web service part so you can test without an actual web service.
 
reply
    Bookmark Topic Watch Topic
  • New Topic