This wouldn't happen to be a class assignment now would it?
I'll give you a hint:
<pre>
boolean[] digitsFound = new boolean[10]; // elements initialized to false by default
while (more digits) {
int nextDigit = ... ;
if (digitsFound[nextDigit])
// duplicate digit found!
// can exit loop now if you like
else
digitsFound[nextDigit] = true;
}
</pre>
You will want to use % and / (integer division) too...
Good luck and welcome to JavaRanch!
------------------
Junilu Lacar
Sun Certified Programmer for the Java� 2 Platform
[This message has been edited by JUNILU LACAR (edited October 19, 2001).]
[This message has been edited by JUNILU LACAR (edited October 19, 2001).]