• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can nodes contain objects?

 
John Lockheart
Ranch Hand
Posts: 115
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 115
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note: You can edit your posts by clicking on the paper/pencil icon.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm guessing that nodes might be a little advanced for the beginners forum, so let's promote this to the intermediate forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic