944,055 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 309
  • Java RSS
Nov 5th, 2009
0

Question about tables

Expand Post »
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..

Java Syntax (Toggle Plain Text)
  1. if(tab1[i] == tab1[i])
  2. System.out.println(tab1[i]+" is already used");
  3. //reduses index
  4. i--;
  5. kb.nextLine();
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
2Mas is offline Offline
1 posts
since Nov 2009
Nov 5th, 2009
0
Re: Question about tables
write the method
Quote ...
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...
Last edited by quuba; Nov 5th, 2009 at 1:28 pm.
Reputation Points: 123
Solved Threads: 106
Posting Pro
quuba is offline Offline
573 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Error on repairing program
Next Thread in Java Forum Timeline: Reasigning variables





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC