Implement printArray.