What are the conditions for two classes to have concurrent access - ProProfs Discuss
Advertisement

What are the conditions for two classes to have concurrent access problems?

Asked by Dhaya, Last updated: Dec 31, 2023

+ Answer
Request
Question menu
Vote up Vote down

1 Answer

John Smith

John Smith

John Smith
John Smith

Answered Jul 03, 2017

Public synchronized int read(){return a+b;} b.public synchronized void set(int a, int b){this.a=a;this.b=b;}
Public int read(){synchronized(this){return a+b;}} public void set(int a, int b){synchronized(this){this.a=a;f.this.b=b;}}
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.