I wanted to add an array as an instance field, also a part of an object, however it gives me interesting errors when i try to do so:
class Surgeon {
private String[] surgeons;
public Surgeon() {
this.surgeons = {"Romero", "Jackson", "Hannah", "Camilla"};
}
public static void main(String[] args) {
Surgeon surg = new Surgeon();
}
}
And it gives me three errors.
This does not make any sense bc is it not how you initialize an array?