How do I clear an array, by filling it in with all zero using an if statement?
I tried this
static void ClearMySize(){
if(MySize != null){
Arrays.fill(MySize, 0);
PrintMySize();
}
System.out.println("\nArray has been cleared: " + Arrays.toString(MySize));
PrintMySize();
Menu();
}
But that doesn't work. It just seems to crash my code.
Aucun commentaire:
Enregistrer un commentaire