New to File I/O and java in general. Doing a project that i have to read in text from a txt file assign them to arrays. This is what i have right now, (all this does is read the text from the file and output it to console) just wondering how you assign these to arrays (later implementing in a trivia type game with a gui)?
package pokemontrivia;
import java.io.*;
import java.util.*;
public class Pokemontrivia {
public static void main(String[] args) throws FileNotFoundException, IOException {
InputStreamReader reader = new InputStreamReader(Pokemontrivia.class.getClassLoader().getResourceAsStream(".\\pokemontrivia\\pokemontriviaquestions.txt"));
BufferedReader in = new BufferedReader(reader);
String line;
while((line = in.readLine()) != null)
{
System.out.println(line);
}
}
}
This is what is on my txt file
What shiny Pokemon can you catch in 2nd Generation Pokemon games?
What 2 Pokemon do you need in your party to catch the Regi's? What Pokemon game is from the 3rd Generation?
How many Pokemon species are there?
What Pokemon can you trade for an Onix in 2nd Generation Pokemon games?
Which haircut brother gives you the most friendship?
How many evolutions does Eevee have?
What is the last evolution of Bulbasaur?
Which Pokemon was the first Pokemon to let you play as a girl?
What are the 3 starters for Generation 4?