program enter element
and if num is already exist give message enter other number no duplicate
my code give me alwayes else condition
/**
* @(#)Enter.java
*
*
* @author
* @version 1.00 2011/11/18
*/
import java.util.Scanner;
public class Enter {
public static void main(String []args){
Scanner input=new Scanner(System.in);
int size ;
System.out.println("plz size");
size=input.nextInt();
int [] a = new int [size];
System.out.println("plz element");
for(int i=0;i<a.length;i++)
{ for(int j=1;j<a.length-1;j++){
if (a[j]!=a[j-1])
a[i]=input.nextInt();
else
System.out.print(" NO Enter other num");
}}
for(int m=0;m<a.length;m++)
System.out.println(a[m]);
}
}