• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Arraylist implementation of queue interface  RSS feed

 
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)


 
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
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!