logo

Crowdly

Le code suivant affiche quelle valeur à l'exécution : class Automobile { ...

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

Le code suivant affiche quelle valeur à l'exécution :

class Automobile {

private static int nbRouesMotrices = 2;

public static int donneNbRouesMotrices() { return nbRouesMotrices; }

}

class QuatreQuatre extends Automobile {

public static int donneNbRouesMotrices() {

return Automobile.donneNbRouesMotrices() + 2;

}

}

class Test {

public static void main(String[] args) {

Automobile auto = new QuatreQuatre();

System.out.println(auto.donneNbRouesMotrices());

}

}

More questions like this

Want instant access to all verified answers on moodle.univ-lr.fr?

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