In a barber shop there are 2 doors. customer come in 1
door, leave in other. minimum # of chairs. barber spend his
life in cutting. always barber can cut 1 customer. few
chairs in the shop. if barber busy customer waits, if
chairs full, customer leave. if no customer, barber sleeps.
treat barber and customer as 2 threads. you can use
Semaphore class with arrive and depart and count as
parameter.


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More Java Related AllOther Interview Questions

What type of parameter passing does java support?

0 Answers  


What is cache in java?

0 Answers  


When do we go for java 8 stream api? Why do we need to use java 8 stream api in our projects?

0 Answers  


How do I open my java console?

0 Answers  


What is entitymanager in jpa?

0 Answers  






What are the differences between java’s old java date api and java 8’s date and time api?

0 Answers  


What is servlets.

10 Answers   HCL, Infosys,


What is csrf in java?

0 Answers  


What is scrollable resultset in java?

0 Answers  


What gives java it’s “write once and run anywhere” nature?

0 Answers  


What is phantom memory?

0 Answers  


What is the difference between map and flatmap in java?

0 Answers  


Categories