logo

Crowdly

Browser

Add to Chrome

Що буде виведено у результаті виконання програми? class s implements Runnable ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Що буде виведено у результаті виконання програми?

class s implements Runnable

{

    int x, y;

    public void run()

    {

        for(int i = 0; i < 1000; i++)

            synchronized(this)

            {

                x = 12;

                y = 12;

            }

        System.out.print(x + " " + y + " ");

    }

    public static void main(String args[])

    {

        s run = new s();

        Thread t1 = new Thread(run);

        Thread t2 = new Thread(run);

        t1.start();

        t2.start();

    }

}

0%
0%
100%
0%
0%
More questions like this

Want instant access to all verified answers on vns.lpnu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome