Hi experts,
I have a question on generating a hashtable which contains only unique numbers. Can anyone help me out. My code is here.
I want to check if the key and value are in the hashtable or not. if they are in the hashtable i break to start generate a random row and column and then check whether the pair is in the hashtable or not. I could not figure out how to do. Also i get an error when breaking to the label start. the compiler says undeclared START. Can anyone help me please. I need it urgent.
while(counter != random_Value){
START:
randomRow = random_element.nextInt(9);
randomColumn = random_element.nextInt(9);
if(!(mapRowCol.containsKey(randomRow)))
{
mapRowCol.put(randomRow, randomColumn);
System.out.println("Row, Col: " +mapRowCol.entrySet());
}
else{
System.out.println();
// break START;
}
counter++;
System.out.println("Counter: "+counter);
}
Thank you very much. Little help is appreciated !