CS174: OOP - Drills - Printing array with commas

Developed by Professor Tralie and Professor Mongan.


Exercise Goals

The goals of this exercise are:
  1. To declare a public static method to some specification
  2. To do proper array indexing
  3. To use loops in concert with arrays
  4. To use logic inside of a loop
  5. To use the System.out.print method properly
Declare a void method printArray in the ArrayPrinter class. This method should take an array of ints, and it should then print out the elements of the array separated by commas (this is useful, since printing out an array by default in Java just gives its memory address). For example, the array {0,5,2,4} should be printed out as 0, 5, 2, 4. Note how there is no comma or space at the end of the output string.
Welcome to our online modules system! Be sure to log in with your Urinus ID before you proceed. For example, Professor Tralie's ID is ctralie. If you are not an Ursinus student, that's fine! Just make something up, and you can still run everything