ericworldz
asked on
check element exists in a list collection
how to check if an element exists in a list?
i have a private instance var : private List account;
// the list start with an index of 0, -1 to prevent IndexOutOfBoundsException
int _accountNumber = accountNumber - 1;
Account _account = (Account) account.get(_accountNumber );
how to check that _accountNumber does exist in the account list? if not i want to throw an exception error.
thanks!
i have a private instance var : private List account;
// the list start with an index of 0, -1 to prevent IndexOutOfBoundsException
int _accountNumber = accountNumber - 1;
Account _account = (Account) account.get(_accountNumber
how to check that _accountNumber does exist in the account list? if not i want to throw an exception error.
thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.