It's not terribly clean, but you could use indexOf() and check if it returns -1. Better than breaking out a loop.
This workshop implements exercises with one-dimensional arrays, matrices, and dynamic lists (ArrayList) in Java. It was developed applying principles of Object-Oriented Programming (OOP), Clean Code, ...
In Java, an array is a fixed size structure used to store multiple values of the same type under one variable name. When an array is created, its length is set and cannot change. Elements are accessed ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results