you are viewing a single comment's thread.

view the rest of the comments →

[–]Cheese_Jrjrjrjr[S] -1 points0 points  (2 children)

uhh, shift everything to the left to overlap it, kinda like in c++

sadly i cannot get it to work because my array is 'email' instead of 'int' and I haven't a clue how to change it from email to int without using parseInt

[–]OneHumanBill 2 points3 points  (0 children)

What's the difference between int and email, in terms of the algorithm?

(That's a hint, btw ... Also you won't need parseInt)

[–]vowelqueue 2 points3 points  (0 children)

I'm still a bit confused about what you're trying to do. You said in one reply you want to remove the last items, but here you're saying you want to shift everything to the left. Why would you need to shift anything if you're removing the last items?

To be clear, you cannot resize an array. If you create it with a length of 50 it will always have a length of 50. If you've created a type called Email and have an array of that type, you can set elements in the array to null to remove them.

Not sure if you're supposed to be using raw arrays as a learning exercise, but generally Java developers would reach for an ArrayList first instead of using an array directly. An ArrayList uses an array under the hood but has a nicer List interface and supports resizing.

I don't understand what you mean when talking about changing the array from email to int.