hi
i was writte program that implement one-d array
user enter 10 element without any duplication
it is give me all element its already exist
import java.util.Scanner;
public class Duplicates {
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int[] array = new int[10];
int[] copyarray = new int[10];
System.out.println(" Enter 10 integers: ");
int i ;
for(i=0;i<array.length;i++)
{
array[i]= input.nextInt();
copyarray[i] = array[i];
if ( array[ i ] == copyarray[ i ] )
System.out.println("plz enter other element because uoyr element is already exist");
else
System.out.println("\n "+array[i]);
}
}