Results 1 to 5 of 5
  1. #1
    yma16 is offline Member
    Join Date
    Apr 2011
    Posts
    52
    Rep Power
    0

    Default confusion about the Note class

    Here is the link
    Node

    It said

    Node(E initialData, Node<E> initialLink)
    Initialize a node with a specified initial data and link to the next node.

    Parameters:
    initialData - the initial data of this new node
    initialLink - a reference to the node after this new node--this reference may be null to indicate that there is no node after this new node

    Is the initialLink a Node object which has the initialData part? It sounds like initialData is ignored and only the reference to the next node is useful.

    In the next link
    Linked list - Wikipedia, the free encyclopedia

    initialLink's picture is an arrow. Where is the data part?

    Thanks.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default

    initialData: value that "this" Node contains.
    initialLink: a reference to the next Node in the List.

    Java Code:
    Node<String> n1 = new Node<String>("one", null);
    Node<String> n2 = new Node<String>("two", n1);

  3. #3
    yma16 is offline Member
    Join Date
    Apr 2011
    Posts
    52
    Rep Power
    0

    Default

    Is n2.initialLink.initialData "one"?

    Thanks.

  4. #4
    yma16 is offline Member
    Join Date
    Apr 2011
    Posts
    52
    Rep Power
    0

    Default

    I tried the code and used

    import edu.colorado.nodes;

    It had an error
    package edu.colorado does not exist.

    Is there a way to use it?

  5. #5
    ra4king's Avatar
    ra4king is offline Senior Member
    Join Date
    Apr 2011
    Location
    Atlanta, Georgia, US
    Posts
    396
    Rep Power
    4

    Default

    The class files or the Jar file have to be in the classpath or build path.

Similar Threads

  1. things necessary to take note of before going to learn EE
    By kulangotski in forum New To Java
    Replies: 0
    Last Post: 12-28-2010, 06:30 AM
  2. Confusion here @@' Help!
    By pleasurelyours in forum New To Java
    Replies: 7
    Last Post: 06-09-2010, 03:42 PM
  3. SCJP Handwritten Note
    By arudra.scjp in forum Java Certification
    Replies: 0
    Last Post: 08-14-2009, 01:24 PM
  4. Replies: 5
    Last Post: 07-26-2009, 03:37 PM
  5. note while compiling
    By j2vdk in forum New To Java
    Replies: 3
    Last Post: 09-03-2008, 11:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •