Java synchronization task

I have a task to write simple booking system, I have done it except one thing, the last task I could not understand it properly, can you please give me how I can approach this last problem because I dont know even how to form a question about it and search in google:

Try to redesign your application so that it is still thread-safe, but without using locking mechanisms (i.e. without synchronization or
java.util.concurrent.locks)

So you need to use classes from the package java.util.concurrent.atomic, indeed they allow you to make your class thread safe without paying the price of a lock since they propose a lock free approach.

Here is how I would modify your code to make it thread safe without using intrinsic or explicit locks:

public class Bus {
private final AtomicIntegerArray seats = new AtomicIntegerArray(50);
private final AtomicInteger nextSeat = new AtomicInteger();
public void bookSeat() throws Exception {
// get the next value, then increment the sequence
int next = nextSeat.getAndIncrement();
// check if we don't exceed the size of the array
if (next < seats.length()){
// Set the value at the index "next" to "1" for booked
seats.set(next, 1);
System.out.println("Seat number " +nextSeat+ " booked");
} else {
System.out.println("The bus is full sorry");
}
}
}

NB: I use an AtomicIntegerArray as there is no equivalent for boolean and we
need an array with volatile values so simply 0 is false and 1 is true.