• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

synchronization test

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
public class SyncTest
{
private int x;
private int y;
public synchronized void setX (int i) (x=1
public synchronized void setY (int i) (y=1
public synchronized void setXY(int 1)(set X(i); setY(i)
public synchronized Boolean check() (return x !=y
}

hi all,
can anybody suggest whts the output with the explanation for the above program?

thanks,
venkat
 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no output as you have no main method or and none of the methods are called. This is only a partial code snippet, your question cant tbe answered.

//Tom
 
Slideshow boring ... losing consciousness ... just gonna take a quick nap on this tiny ad ...
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic