Examlex

Solved

Examine the SharedData Class Shown Below

question 45

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 ten times with values 1...10 respectively, sleeping for a random number of milliseconds between calls. Thread two calls getSharedData eight times, also sleeping for a random number of milliseconds between calls. Which of the following could be the last two values received by thread two?
Public class SharedData
{
Private int value;
Public void setSharedData(int n)
{
Value = n;
}
Public int getSharedData()
{
Return value;
}
}


Definitions:

Accounts Receivable

Receivables from customers for goods or services provided but not yet compensated.

Effective Annual Interest Rate

The interest rate on a loan or financial product restated from the nominal rate as an annual rate that reflects compounding over a given period.

Cash Cycle

The period of time it takes for a company to convert its investments in inventory and resources into cash flows from sales.

Receivables Period

The average number of days it takes for a company to collect payments from its customers.

Related Questions