Hello bobleny,
To read in the contents of a text file and add each line to an array, use this code:
FileInputStream in = new FileInputStream("yourFile.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
String[] myarray;
myarray = new String[4];
for (int i = 0; i < myarray.length; i++){
myarray[i] = br.readLine();
}
in.close();
Then you can print out the array content to the console using:
System.out.println(myarray[0]);
System.out.println(myarray[1]);
System.out.println(myarray[2]);
System.out.println(myarray[3]);
Hope this helps!