Search:

Type: Posts; User: javaStooge

Search: Search took 0.15 seconds.

  1. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    I realized my Node type does not need a generic type (located in the Node class), but then I get the error above when I remove it. Is there a way to avoid this? I've also tried to define the type,...
  2. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    *Updated* I forgot to add the exception class. :(|)

    I've outlined the linkedlist concept on pen and paper, and feel I have a fairly good grasp of it. (I'll be sure to use the "process" you...
  3. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    main

    public class MainClass {

    public static void main(String[] args) throws PointerOutOfBoundsException {

    // StringX star = new StringX("Betelgeuse");...
  4. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    Hey Norm, walked away for a bit.

    The error after compiling.


    Now, I made a quick change and I got the newMember to print..by some miracle. It is still throwing the error though. Line 128 is...
  5. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    I've checked my code against several different source and I don't see any serious difference. there is nothing unique about my code and yet it still returns a nullpointer error. Can you guys please...
  6. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    temp.next will have the address of the current head node...but it will contain the newest member in the list. Head should always remain the first link in the list -- that is why I used newNode =...
  7. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    Ok, lets start with the addToFront method:
    1. I understand the if statement...its saying if a node is empty, add the new node with its member, assign it as head, and link it with old head.
    2. If...
  8. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    Would you mind explaining to me exactly what is going on here. What is newNode.next = tail accomplishing? In my class NodeList, next is defined as NodeList<T>...which is the format I've adopted from...
  9. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    Thank you guys. I thought so, but I just wanted to make sure -- I saw an example where they created separate classes for the two but they weren't using generics.


    public class NodeList<T> {...
  10. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    Is it possible create a single Node class (Node<T>) that can account for a list for integers and a list for strings? Or is it better to create a separate class to do this?
  11. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    I'm not trying to compile it yet...I'm not ready for that. I have my other classes...I just provided the class with the issue. I thought the issue was contained within this class alone.
  12. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    public class MySinglyLinkedListD<T> implements SinglyLinkedList<T> {

    protected ListNode<T> head, tail, current;
    String name;
    int size = 0;

    //Simple constructor
    ...
  13. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    That is all the error message contained.

    next() is defined within the same class where I am trying to use it---that's what I don't understand. I'm having the same issue when I try to use my...
  14. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    Posted here to make sure it notified you.

    cannot find symbol
    symbol: method next()
    location: variable newNode of type ListNode<T>
    where T is a type-variable:
    T extends Object declared in class...
  15. Replies
    33
    Views
    2,470

    [SOLVED] Re: LinkedList -- insert()

    The hasNext() method supposed to return whether the next element or node is empty and return that node or return the node value.
    I'm having a little trouble with the next() method. I want to test...
  16. Replies
    33
    Views
    2,470

    [SOLVED] LinkedList -- insert()

    For this program I am dealing with the linkedlist interface. I am designing a method "insert" that will add a new member to a specified location provided by the user (public insert(T newMem, int...
Results 1 to 16 of 16