0
Question about updating array
I use array to store data and I get this data in many methods including JButton ActionEvent by using the statement ~record [] record = new record[100];~. How to store new data to the array so that the data can be updated in other method in the same time? I also use set and get method to create the array.
3 Antworten
+ 2
i think you should complete the java course first
0
one way is to pass it over to the method that needs the records.
i.e.
Record [] record = new Record[100];
// ... some code here
myFunction(record);
private void myFunction(Record[] input){
// now i can manipulate the record
input[0] = new Record();
....
}
0
What is myFunction?