Question: Write a Java class for an automated booking system for a theatre. The system must support multiple users that are allowed to book a single

Write a Java class for an automated booking system for a theatre. The system must support multiple users that are allowed to book a single seat at a time from a list of available seats. The system must ensure that double booking is not permitted whilst allowing clients free choice of available seats. This means that a seat may appear to be free although it may be booked or in the process of being booked by another client. Implement a class that allows users to book seats whilst not permitting double booking. You should write to methods getSeats and bookSeat. Use ReentrantLock in your code.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!