I have the following class:
public class Person {
private String id;
private Score[] scores;
public Person() {
}
//getters and setters etc
}
How can I best remove all the Score objects within the scores array for this object?
re initialize the array new Score[size] or Use Arrays.fill method.
I'd use Arrays.fill and fill the array with nulls.
Arrays.fill(scores, null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With