A Vector (or, better, ArrayList) works. It is good enough. You'll pass alright. But it is not the most appropriate data structure; if the Collections framework is in your repertoire (and being an
SCJP, it should be) then I don't understand why on earth you'd pick a substandard solution if using the real thing takes no more time.
Apart from performance - which can be argued to be unimportant - the locks are quite simply not a List. Locks aren't ordered. They can't have duplicates. This makes them a Set. Storing them in a List data structure means that the code is misleading in its expression, which is poor programming by any standard.
- Peter