Hi, I'm wondering if it's able to read questions (for my math game) from a file and the game displays it? There is a battle scene where the player gets asked maths question by an enemy and the player answers via multiple choice (another issue that I'm struggling on but I'll think about that later). I've searched around on google and came across the FileReader command in the java.io library but I'm confused on how to use it?
This is what I have so far:
Of course I'm also worried about whether reading questions from a file is actually a good idea. I'm wondering if it's better if I just store the questions (and answers) into the game itself.
public void ReadQuestions() throws Exception { String file = "Questions.txt"; String line; while((line = in.readLine()) !=null) System.out.println(line); }