I have an int table, consisting of 7 ints, and is wondering if there is any way of avoiding the same int to be entered twice. And if entering the same int twice, the user of the program would have to re-enter the int again.

this is what i've got so far, but it doesn't seem to work at all..

if(tab1[i] == tab1[i])
				System.out.println(tab1[i]+" is already used");
				 //reduses index
				 i--;
				 kb.nextLine();

write the method

boolean contanis(int i)

in this method loop around the array, if value associated with current loop-index is equal to i-value return true...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.