I need to compare two sets of numbers in Java. For the sake of testing the program the two sets will be the same (123) except one set will have "123" in different orders. I am currently inputing "123" as the winning number and "321" as the playing number using the .contains() method to compare the two as Strings.
My code is as follows:
if (playNum.contains(winNum))
System.out.println("True") ;
else
System.out.println("False") ;
Im trying to get the program to recognize any variation of '123' as a winner. Any help would be great appreciated.
Aucun commentaire:
Enregistrer un commentaire