wood burning stoves 2.0*
The moose likes Java in General and the fly likes Can nodes contain objects? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Can nodes contain objects?" Watch "Can nodes contain objects?" New topic
Author

Can nodes contain objects?

John Lockheart
Ranch Hand

Joined: Oct 13, 2006
Posts: 115
I created a node class, and then a LinkedList class which builds a linear linked list and creates new nodes. I want to create a TokenAdress object which stores a line number and which token number on the line a word was. And I want my nodes inside my list to contain these TokenAdress objects. Is this possible? Can a node contain anything you want it to or just integers?
John Lockheart
Ranch Hand

Joined: Oct 13, 2006
Posts: 115
LOL, sorry to waste a post guys, I realised I didn't change my private variable decleration inside the class from int to object, so it thought value was supposed to be an int...I'm tired, just got off word...SORRY!

p.s. Since I only want to store TokenAdress (somethin i created) objects inside my nodes, should I maybe change private Object value => private TokenAdress value. Or should I leave the object decleration?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Note: You can edit your posts by clicking on the paper/pencil icon.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

I'm guessing that nodes might be a little advanced for the beginners forum, so let's promote this to the intermediate forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can nodes contain objects?