• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with searching though a linked list given and displaying it given an integer.  RSS feed

 
Nikolas Spendik
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, i need help with a part of my program where I need to display an object, which is in a linked list, given a vin number. It is the display_info method. Any help is appreciated I have put two of my classes below.

Here is what i have so far:



 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest you use a for-each loop to iterate over the linked list and then inside the loop test the input number against the vin number of the Car object.

BTW why are you not using generics throughout your code? and why are you calling your car list someList which is really doesn't tell you anything about what the list is likely to contain?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!