Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Updating a specific value in a linked list

  1. #1
    Junior Member pyler's Avatar
    Join Date
    Sep 2012
    Posts
    23
    My Mood
    Busy
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Exclamation Updating a specific value in a linked list

    I create and populate someLinkedList with '*' characters as soon as a gameLinkedList object is created, so my class is something like
    private int size;
    public class gameLinkedList{
    private CharNode game;
    public gameLinkedList(String someWord){
    size=someWord.length();
    for(int i=0;i<size;i++){CharNode aNode = new CharNode('p');
    if(CharNode==null){game=aNode;}
    else{aNode.setLink(game);game=a;}
    }
    }
    public boolean exists(guess){return someWord.indexOf(guess);}
    //take a character, compare it to all characters
    public boolean play(char c){
    CharNode newNode=new CharNode(guess);
    if(exists(guess)){
    //insert newNode into aNode at the position corresponding to the guess character's //position in someWord
    }}
    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Updating a specific value in a linked list

    Please edit your post and properly format the code. Nested statements should be indented.

    Do you have a question about the code?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. [Linked List] Problems deleting items from a linked list
    By KLVTZ in forum What's Wrong With My Code?
    Replies: 7
    Last Post: March 8th, 2013, 09:21 PM
  2. [Linked List] Problems deleting items from a linked list
    By KLVTZ in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 8th, 2013, 07:52 PM
  3. Replies: 1
    Last Post: October 25th, 2012, 02:03 PM
  4. Linked list Schminked list help with Nodes Please
    By Bially in forum Collections and Generics
    Replies: 1
    Last Post: September 29th, 2011, 03:20 PM
  5. Selecting a specific list
    By sapzero in forum Java Theory & Questions
    Replies: 1
    Last Post: January 23rd, 2011, 12:06 PM

Tags for this Thread