john kidwell wrote:
But my output is coming out like this:
What am I doing wrong??
The stacktrace is saying... in Sport.java, at line 40, is the main() method of the Sports class. At that line, an array is accessed using an index of 2. Unfortunately, the array doesn't have an index of 2, likely because the array is smaller in size.
You need to go to that line, and figure out why the array access is out of bounds -- either the array is created of the wrong size, or the index calculated is wrong.