Cpp Copy Array Into Another Arraylist Sort Methods In Java