In think in java, as far as I know, adding elements(objects) at the end of an array is easy. But inserting and deleting the elements in the middle of the array is difficult. In this case, we have to re-arrange all the elements of the array.(By using some sort of sorting techniques.) Then possibly you can process the elements in your case.
Remember that array holds elements of only one type of datatype. If you want different objects in a single array, you have to use Collections concept. You can use Collection concept even on arrays which have elements of single data type.
Also I think, retrieving the elements from an array is easy but after retrieving the elements, if we want to process them, then there are no methods in java to carry this out.
OR
The alternative or the only way could be to use wrapper classes to convert each element in an array to an object and use a 'different object' to store all of these objects. This 'different object' is called Collection object.The Collection object actually stores the references of other objects, not the physical copies of other objects. Collection object never stores primitive data type, stores only objects.That is why there is a concept called Wrapper classes introduced. Collection object belongs to Collection class. Collection class belongs to java utility package.
There are several Collection classes in java utility package to process these elements(objects). We are advised to use these classes at our discretion. We have to decide which Collection class(generic class) is best suited to process our requirement/problem.
I think you should go through the concepts of Collections thoroughly.
You should be familiar with Type casting, Wrapper classes and Collections.

Yes, I'm sorry I wasn't clear on that. Any repeating integer will be removed (not the integer itself). Yes, I'm still stuck on how to remove the duplicate, checking for duplicates is somehow working.

Since you're stuck here, the most common method to remove a duplicate is to move the remaining values in the array down one position, so that the value to be removed is overwritten by the first of the remaining values. After doing this you need to consider the size of the array as reduced by 1. So now the question is how would you move the remaining values down one position within the array?

You have already figured out how to, for each item in the array, find all duplicates of that item further in the array.
But instead you need to figure out how to determine whether or not an item should be added to the new array. When should an item not be added to the duplicate free array, if it already has some items in it?

"Plan B" probably better for you. It should be simpler than "Plan A" to implement. Also, typically many less operations will be required, so we'd expect "Plan B" to execute faster. The memory savings from using "Plan A," (an "in-place" algorithm) is not significant in this case.

Suppose I want to find the duplicates in an array but I don't know how many elements I am going to give to the array. And while I enter the values it should display that I have entered duplicate elements. Here, I want to know how do I accept array elements dynamically. If it's not possible in array. Then is there any way in java that I can accept elements dynamically from the keyboard during run-time and so that I can prompt the user to enter a different value if the user entered a duplicate value?
Main question is: I want to enter elements during run-time in java and I don't know how many elements I am going to enter. How do I do that?