Open and writing to file in java with netBeans

Hi I am currently writing a program which uses an array. Each time the program is run i want it to open a file containing the array and add to the array then saves the file after.