I'm just at the beginning but cannot find answer for my question. For any ideas will be very grateful.
I need a list which is filled for a half only with random positive digits, and another half only with random negative. The list should be added to a file
I do not understand how to do that. Any ideas?
For now I only can write String in a file like:
try (BufferedWriter wr = new BufferedWriter(new FileWriter(numbers));
BufferedReader rd = new BufferedReader(new FileReader(numbers)) {
if (numbers.exists()) {
for (int i = 0; i <= 100; i++) {
wr.write(String.valueOf((i) + " "));
}
for (int a = -1; a >= -100; a--) {
wr.write(String.valueOf((a) + " "));
}
}
}