logo

Crowdly

Soit la classe public class Tester {     private int test1;     private i...

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

Soit la classe

public class Tester {

    private int test1;

    private int test2;

     public Tester(int i, int j) {

      this.test1 = i;

      this.test2 = j;

     }

    int get(int i) {

       switch(i) {

       case 1 : return this.test1; break;

       case 2 : return this.test2;

       }

    }

}

Dans une classe ExecutableTester, on écrit les instructions

Tester tester1 = new Tester(3, -2);

Tester tester2 = new Tester(2 + 1, -6 + 4);

Integer val1 = tester1.get(2);

Integer val2 = tester2.get(2);

System.out.println(val1 == val2);

Quel sera l'affichage ?  (true : vrai, false : faux)

More questions like this

Want instant access to all verified answers on celene.univ-orleans.fr?

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