reset password
Author Message
Canhong Huang
Posts: 10
Posted 15:35 Sep 15, 2019 |

After I create a copy of the input array named noDuplicate, then I assign it to the data field. Then I found out that my get() method gone wrong when I try S.o.p(set2.get(0)) in the tester. It suppose to get the set[0] for me.

this is my second constructor:

Code Removed by Keenan, Do not post code on the forums.

 

If your array is out of bounds it means that you should check that your indexes are the correct bounds.

Last edited by kknaur at 16:01 Sep 15, 2019.
Canhong Huang
Posts: 10
Posted 17:38 Sep 15, 2019 |
Canhong Huang wrote:

After I create a copy of the input array named noDuplicate, then I assign it to the data field. Then I found out that my get() method gone wrong when I try S.o.p(set2.get(0)) in the tester. It suppose to get the set[0] for me.

this is my second constructor:

Code Removed by Keenan, Do not post code on the forums.

 

If your array is out of bounds it means that you should check that your indexes are the correct bounds.

it works before i done my removeDuplicate method, but since i tried to remove duplicates before assign to data field, it didnt assign the no-duplicate array to data field. I tried to fix it but still have no idea why it doesnt work

Canhong Huang
Posts: 10
Posted 18:39 Sep 15, 2019 |

it always said is out of bounds, but i dont know what's wrong with my array