Search:

Type: Posts; User: Mr.777

Search: Search took 0.26 seconds.

  1. Re: Beginner/Intermediate Java Code - NullPointerException and wrong output.

    Did you try debugging your program?
    If you don't know debugging, place print statements to find the value of your queue(list) at different locations.
  2. Re: Beginner/Intermediate Java Code - NullPointerException and wrong output.

    int numShares = StockList.peek().getShares();

    Most probably, this StockList.peek() is returning a null and you want a null to call getShares(). That is actually the problem. Good Luck
Results 1 to 2 of 2