How can I check if a value that is written in scanner exists in an ArrayList?
List lista = new ArrayList
When Array List contains object of Primitive DataType.
Use this function:
arrayList.contains(value);
if list contains that value then it will return true else false.
When Array List contains object of UserDefined DataType.
Follow this below Link
How to compare Objects attributes in an ArrayList?
I hope this solution will help you. Thanks