Осторожно с массивом объектов
Dog[] pack = new Dog[2];
System.out.println(pack[0]); // null — НЕ собака!
This is the trap: new Dog[2] creates room for two dogs, but no dogs. Every slot is null until you build an object and put it there. Touching pack[0].name right away crashes with a NullPointerException.
Rule: creating an array of objects and filling it are two separate steps.