View Single Post
  #6 (permalink)  
Old 11-23-2007, 12:38 AM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,022
hardwired is on a distinguished road
Now if i make my enter and exit methods static and delete the Garage garage from the constructor, do u suggest it to be a good alternative?
No.
well i tried it. it gives me an error that non-static method i.e.notifyAll and wait cannot be used in static.
That makes sense. You can look up these methods in the Object class api to see that they are both declared public.
There may be a number of other ways you can do this. For more about this try Lesson: Concurrency.
Reply With Quote