• 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

How can i check if the input is the same as the hashmap key.

 
Greenhorn
Posts: 7
Python Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this library system where i got bookdata stored in a textfile. and person data stored in another text file.

- I need to check if String isbn = sc.next(); is the same as the hashmap-bokm key (isbn) in class Bok.
The Bok bokm hashmap is made in another class that reads the file in.
Same with the Person personm which will later read in the data typed here.
What i am trying to do is to make an if test so that if isbn is in hashmap then

bufferedWriter.write(isbn+";"+now()+";"+nr+";"+name+";");
bufferedWriter.newLine();

else errormessage and retry!

reply
    Bookmark Topic Watch Topic
  • New Topic