How can I check if a String is there in the List?
String
List
I want to assign 1 to temp if there is a result, 2
1
temp
2
The List interface already has this solved.
int temp = 2; if(bankAccNos.contains(bakAccNo)) temp=1;
More can be found in the documentation about List.