Search:

Type: Posts; User: JonLane

Search: Search took 0.18 seconds.

  1. Replies
    19
    Views
    2,045

    Re: Weird problem with my linkedlist

    Well, you know why null pointer errors exist?

    BECAUSE THEY FEEL SO DAMN GOOD ONCE FOUND!

    Glad we could help.
  2. Replies
    19
    Views
    2,045

    Re: Weird problem with my linkedlist

    see two posts above
  3. Replies
    19
    Views
    2,045

    Re: Weird problem with my linkedlist

    add this to your toString statement,
    The reason you were not getting the first (highest) node is because you skipped doing anything with head.


    if(head != null)
    {
    output += "(" +head.Element1...
  4. Replies
    19
    Views
    2,045

    Re: Weird problem with my linkedlist

    I played with your new poly method, and it never seems to print the first/ highest poly, but they seem to order correctly
    I would look in your print (toString?) for this slight oversight.

    The...
  5. Replies
    19
    Views
    2,045

    Re: Weird problem with my linkedlist

    just because an error occurs when trying to add, doesn't mean add is the problem.
    rather then "look" through code you have to "trace" through it.


    Elaboration:
    these are the exception paths....
  6. Replies
    19
    Views
    2,045

    Re: Weird problem with my linkedlist

    Norm the run-time data is as follows:


    -12
    5
    Exception in thread "main" java.lang.NullPointerException
    at Polynomial.add(Polynomial.java:46)
    at...
  7. Replies
    19
    Views
    2,045

    Re: Weird problem with my linkedlist

    With out getting to deep in your code, rather then remove "buggy" code.
    It is better to replace it with dummy code.



    public Polynomial prep(String s)
    {
    // return //not to sure, but you...
Results 1 to 7 of 7