making 5 objects using a for loop and put it in a array in java code example Example: loop an array of objects in java for(Dog d : kennel) { d.bark(); }