dimanche 15 septembre 2019

Why I am getting an ExceptionInInitializerError when initializing an array of objects

Exception in thread "main" java.lang.ExceptionInInitializerError when trying to initialize an array of objects.

for (int i = 0; i < size * size; i++) {
this.matrix[i] = new Square();
}

output: Exception in thread "main" java.lang.ExceptionInInitializerError ... Caused by: java.lang.IllegalStateException: Toolkit not initialized




Aucun commentaire:

Enregistrer un commentaire