Hi All
I am new to java. I am facing a problem
I want to compare a string to a set of strings,
For example there is variable string x, If the value String X matches to String A , String B, String C then run the particular code otherwise do not run anything and come out of the loop.
My Code is:
if((!X.equals("IND"))&&(!X.equals("AJD"))&&(!X.equals("BE"))){
if (X.equals("IND")) {
try {
System.out.println("Form Type dropdown contains Individual");
} catch (AssertionError e) {
e.printStackTrace();
}
}
if (X.equals("ADJ")) {
try {
System.out.println("Form Type dropdown contains Adjuster");
} catch (AssertionError e) {
e.printStackTrace();
}
}
if (X.equals("BE")) {
try {
System.out.println("Form Type dropdown contains BE");
} catch (AssertionError e) {
e.printStackTrace();
}
}
}else{
System.out.println("Drop Down value does not match Individual, BE, and Adjuster");
}
}
But os not wroking as desired ....:(
Please help!!!
Thanks in Advance...