• Post Reply Bookmark Topic Watch Topic
  • New Topic

Arraylist implementation of queue interface  RSS feed

 
benjamin parker
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm having some error below from the code. i am not sure if i have done the instantiate part correctly.
Exception in thread "main" java.lang.NullPointerException
at ListOrder.addNewOrder(QuickEat.java:32)
at QuickEat.main(QuickEat.java:76)


 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The dishQueues member you declare at line 15 remains null after the ListOrder constructor complets, which causes the NullPointerException.
Have a close look at the code in the constructor that is supposed to assign a value to the dishQueues member. You'll figure it out.
 
benjamin parker
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jelle Klap wrote:The dishQueues member you declare at line 15 remains null after the ListOrder constructor complets, which causes the NullPointerException.
Have a close look at the code in the constructor that is supposed to assign a value to the dishQueues member. You'll figure it out.


yes i figured it out same goes to 19
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!