The Artima Developer Community
Sponsored Link

Java Answers Forum
Linked List

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Laurence

Posts: 5
Nickname: lau03
Registered: Feb, 2003

Linked List Posted: Feb 18, 2003 10:07 AM
Reply to this message Reply
Advertisement
Hi,
Well I'm having the hardest time understanding how to implement a linked list in Java. This is for an assignment, and we cannot use any of the linked list package.
I learned C first, and I really got used to using pointers. Now I'm all confused with the whole "reference" thing in Java. I don't understand this concept!!
So far, all I have is:
void append (int value) {
      info = value;
      this.next = head;
      this.head = next;
} 

and I bet that won't work!!
My main problem is that in C, you create a pointer that's going to point to the whole struct, and that struct's next's pointer (or whatever name you give it) will point to the next element. How do you do that in Java?

Topic: newbie Servlet Help Previous Topic   Next Topic Topic: cannot connect file dialog

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use