When I attempt to run the program I produce a print loop output of
Fredsays Ruff!
Fredsays Ruff!
Fredsays Ruff!
Fredsays Ruff!
Fredsays Ruff!
Unless i move the variable increment to above the call to .bark first.
But then the output errors to
nullsays Ruff!
last dog's name is Bart
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
at Dog.main(Dog.java:24)
My code appears to be the same as that shown above?
I removed an additional } found before the bark because I was getting error thrown otherwise
Dog.java:30: error: class, interface, or enum expected
My code