I write the code
public class keys {
private static final String[] keyss = {
"HGDLV-KLLQC-DM3ON-MAUOX-FNQK5",
"HQKLD-NYRDL-NJXCV-BVCKF-NRKLC",
"LDFCV-BDJCQ-VMFQV-FNRKC-NFCFL"
//and many more
};
public static String getKey(String key) {
boolean b = Arrays.asList(keyss).contains(key);
if (b == true) {
key = "approved";
} else {
key = "unapproved";
}
return key;
}
and gets the approved for all Strings even if the above dosen't match with the user specified string