-3

I need to create a program that can store the names of 5 people and a status message for each. It must be able to display the names and statuses. I also want to be able to change the statuses of any person.

Here on Stack Overflow, the most relevant example to my question is this one. storing names and other information

However, not specific enough as I am a beginner. Any suggestions on good tutorials for such assignment?

I am using Eclipse

Community
  • 1
  • 1
  • 2
    Learn to use Database or file handling – Nabin Sep 01 '14 at 17:25
  • 1
    This question appears to be off topic because Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – Frakcool Sep 01 '14 at 17:26
  • If you're a beginner, you are likely following a book, tutorial or course. Either look ahead to the topics Nabin mentions, or ask your teacher. – AntonH Sep 01 '14 at 17:27
  • You could lay out a fixed width binary file. Assuming you can define a maximum width for `name` and `status`. – Elliott Frisch Sep 01 '14 at 17:29

1 Answers1

0

i would recommend using a Hashmap.

HashMap<String, String> myMap = new HashMap<String, String>();

and using put to assign name to the key set and a message to the value set.

myMap.put("john","This person is never in"); etc
Set set = myMap.entrySet();

// check set values
System.out.println("Set values: " + set);

to print out name and status

takendarkk
  • 3,347
  • 8
  • 25
  • 37
JavaExpert
  • 41
  • 1