logo

Crowdly

On vous donne la classe suivante : public class Animal { private boolean est...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

On vous donne la classe suivante :

public class Animal {

private boolean estVegetarien;

private String nourriture;

private int nbPattes;

public Animal(){}

public Animal(boolean veg, String nourrit, int nbP){

this.estVegetarien = veg;

this.nourriture = nourrit;

this.nbPattes = nbP;

}

public boolean estVegetarien() {

return estVegetarien;

}

public void definirVegetarien(boolean veg) {

this.estVegetarien = veg;

}

public String lireNourriture() {

return nourriture;

}

public void definirNourriture(String nourrit) {

this.nourriture = nourrit;

}

}

  • Combien y a t'il de paramètres dans la méthode definirNourriture de cette classe ?  
  • Combien y a t'il de méthodes  dans cette classe, hors constructeur ?  
  • Combien y a t'il de constructeurs explicites dans cette classe ?  
  • Combien y a t'il d'attributs  dans cette classe ?  

Vos réponses seront données sous forme de chiffre.

Auteur : Benoit Darties

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.epf.fr?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!