If you just want to save and read an int[] from a file, have a look at the ObjectOutputStream and ObjectInputStream classes in java.io. But the data will be saved in binary format, not in human readable, which leads us to the question what you mean by a text file. How exactly do you want to save that array?
Example:int[] arrayToFile = {1,4,566,252,0,454,3,-775,4366,-5455,-28};
ObjectOutputStream oos = new ObjectOutputStream(
new FileOutputStream("c:\\array.dat"));
oos.writeObject(arrayToFile);
oos.close();
ObjectInputStream ois = new ObjectInputStream(
new FileInputStream("c:\\array.dat"));
int[] arrayFromFile = (int[]) ois.readObject();
for (int j=0; j < arrayFromFile.length; j++) {
System.out.println(arrayFromFile[j]);
}
ois.close();