First off, I've only recently started to use Java, so what might seem obvious to others may not appear so to me.
I'm trying to implement a Quiz application and one of the stipulations is that I read the questions from an external file and store the questions in a MAP structure.
I've looked into this and it appears that a MAP stores a key and a value...
Am I right in thinking that I can store an idetifier as the key and then the rest of the information as the value, even though the rest of it consists of 4 elements of two differing data types (2 ints, a string and an array of strings)?
If my assumtion is correct, how would I implement that, as any documentation I have found resembles the following:
HashMap<Integer, String> questionMap = new HashMap<Integer, String>(); Any assistance or nudges in the right direction are greatly appreciated.
The Question class currently consists of (I've remover the getters and setters to save space on here:
public class Question { public int identifier; public String type; public String question; public String[] options; public int answer; }