Examlex

Solved

Examine the SharedData Class Shown Below

question 81

Multiple Choice

Examine the SharedData class shown below. Suppose two threads are created so that each has access to the same SharedData object. Thread one calls setSharedData eight times with values 1...8 respectively, sleeping for 30 milliseconds between calls. Thread two calls getSharedData eight times, also sleeping for 30 milliseconds between calls. Suppose thread two receives values 1, 2, 3, 4, 5, 6, 7, 8 respectively on its calls. Should we expect the same values for each program run? public class SharedData
{
Private int value;
Public void setSharedData(int n)
{
Value = n;
}
Public int getSharedData()
{
Return value;
}
}


Definitions:

Sampling Distribution

The likelihood distribution of a metric derived from numerous samples collected from a certain group.

Sample Mean

The average of all the observations in a sample, used as an estimate of the population mean.

Central Limit Theorem

A statistical theory stating that, given a sufficiently large sample size from a population with a finite level of variance, the mean of all samples will be approximately equal to the mean of the population, with the samples approximating a normal distribution.

Statistical Inference

The process of drawing conclusions about population properties based on a sample taken from the population.

Related Questions