SyntaxFix
Write A Post
Hire A Developer
Questions
The List interface already has this solved.
List
int temp = 2; if(bankAccNos.contains(bakAccNo)) temp=1;
More can be found in the documentation about List.