• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Implementation of Linked List

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator




My problem is I have to implement this method public void filmHinzufuegen(Film film): If the film is not already in the "films" list, then add it to it. Otherwise do nothing. In case of errors (e.g. NullPointerException) nothing should happen.

Is there a way to keep it general?
 
Saloon Keeper
Posts: 15510
363
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have to implement a linked list, or just use the existing one from the standard API? Right now you're using the existing one.

There are a few issues with your code. Most importantly you have a variable named "Film" that doesn't doesn't represent a film, but instead a list of film titles. A list of titles is not a film. Also, start your variable names with a lowercase letter.

The assignment says to write a method filmHinzufuegen(Film film). This implies to me that you need to create a class Film and going by the title of this topic, you must also create a class FilmListe or something similar that contains the filmHinzufuegen method. Start with that and show us how far you got.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic