- use arraycopy to copy an input parameter to avoid sharing the same object