Hi, Mohamed, and welcome to JavaRanch. Since this sounds like a school assignment to me, I'll not give you a solution, but instead will try to point you in the right direction. You say you can't use Collections, but is there anything prohibiting you from creating a second array? Think about how you might use a second array to acheive this. Once you figure out how to acheive this using two arrays, you might realize that this can be done using only the one array (albeit slightly less effeciently, especially if you have to shift the elements in the array whenever you remove an element). Once you have some code ready, feel free to post if for critiquing/debugging. We'll gladly helpwith that part. (Be sure to surround your code with [ CODE ] and [ /CODE ] tags, as it makes it easier for us all here at the ranch to read.)
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.