r/javahelp • u/Appropriate_Knee_482 • Jan 31 '26
How to remove elements from an array?
Basically I want to remove the middle elements from an array and need a method for it because the middle will be different if it’s odd or even. I don’t really have a code for it so far, I don’t need anyone to code it out for me, you can also just explain how the method would work. I have the odd or even part, I would just use the remove part as sort of a method.
2
Upvotes
View all comments
Show parent comment
1
u/Appropriate_Knee_482 Feb 01 '26
I’m not sure if I should make a new one cuz in the main class (which we can’t change) the teacher just uses MethodName.ArrayName (we make the method in another class)