How can I read from a text file and stores the values into a an array list I specified, I have the following code so far
FileReader file = new FileReader("C:\\");
BufferedReader reader = new BufferedReader(file);
String text = "";
String line = reader.readLine();
while (line != null){
text += line;
line = reader.readLine();
}
System.out.println(text);
I want to limit the lines to 6 any line over that should provide an arrow, and I also want to check whether the values given by the user is appropriate. The array list I have created is called arraysList.
The user can enter upto 6 lines, in format, String, double, int, int
The error check I want is say if the integers the user enters is below 0 or above 100 it should provide an error and if the double is below 0 it should provide an error and also if the String does not match
Apple || Banana || Orange || PineApple || Grape || Mango
I want to store each line in the array list, but separate the values so after every space in line, and so on...
Thanks.