File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes how can I print out the value of this list without havig to change evrything to static? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how can I print out the value of this list without havig to change evrything to static?" Watch "how can I print out the value of this list without havig to change evrything to static?" New topic
Author

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

Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

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.?

True wisdom is in knowing you know nothing - Socrates
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19675
    
  18

Create an instance?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

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...
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can I print out the value of this list without havig to change evrything to static?