logo

Crowdly

Browser

Add to Chrome

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

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

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

class BoolArray

{

    boolean [] b = new boolean[3];

    int count = 0;

 

    void set(boolean [] x, int i)

    {

        x[i] = true;

        ++count;

    }

 

    public static void main(String [] args)

    {

        BoolArray ba = new BoolArray();

        ba.set(ba.b, 0);

        ba.set(ba.b, 2);

        ba.test();

    }

 

    void test()

    {

        if ( b[0] && b[1] | b[2] )

            count++;

        if ( b[1] && b[(++count - 2)] )

            count += 7;

        System.out.println("count = " + count);

    }

}

100%
0%
0%
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