logo

Crowdly

R2.01 Developpement Objets

Шукаєте відповіді та рішення тестів для R2.01 Developpement Objets? Перегляньте нашу велику колекцію перевірених відповідей для R2.01 Developpement Objets в celene.univ-orleans.fr.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

//9 @Override public void affiche(){ super.affiche(); System.out.println(this.superficie+" "+this.identifiant); }

Переглянути це питання
    //10

    public Appartement(int superficie, int nbPiece, int identifiant, int numEtage){

        super(superficie, nbPiece, identifiant);

        this.numEtage = numEtage;

    }

Переглянути це питання
//8 public Maison(int superficieJardin){ super(100,4,0); this.superficieJardin = superficieJardin; }
Переглянути це питання
//7 public void affiche(){ System.out.println("Superficie :"+this.superficie+", Nombre pièces :"+this.nbPieces); }

Переглянути це питання
//6 public Logement(int superficie, int nbPieces, int identifiant){ this.superficie = superficie; this.nbPieces = nbPieces; this.identifiant = identifiant; }

Переглянути це питання

//5 appartement.affiche();
Переглянути це питання
//4 maison.affiche();
Переглянути це питання
//3 Logement maison = new Maison(100);

Переглянути це питання
//2 Appartement appartement = new Appartement(50, 2, 6, 2);

Переглянути це питання

Voici une déclaration de plusieurs classes en Java. Des blocs d'instructions sont numérotés.

public abstract class Logement{

protected int superficie;

protected int nbPieces;

private int identifiant;

//6

public Logement(int superficie, int nbPieces, int identifiant){

this.superficie = superficie;

this.nbPieces = nbPieces;

this.identifiant = identifiant;

}

//7

public void affiche(){

System.out.println("Superficie :"+this.superficie+", Nombre pièces :"+this.nbPieces);

}

}

public class Maison extends Logement{

protected int superficieJardin;

//8

public Maison(int superficieJardin){

super(100,4,0);

this.superficieJardin = superficieJardin;

}

//9

@Override

public void affiche(){

super.affiche();

System.out.println(this.superficie+" "+this.identifiant);

}

}

public class Appartement extends Logement{

protected int numEtage;

//10

public Appartement(int superficie, int nbPiece, int identifiant, int numEtage){

super(superficie, nbPiece, identifiant);

this.numEtage = numEtage;

}

}

public class Executable {

public static void main(String [] args){

//1

Logement logement = new Logement(200,8,5);

//2

Appartement appartement = new Appartement(50, 2, 6, 2);

//3

Logement maison = new Maison(100);

//4

maison.affiche();

//5

appartement.affiche();

}

}

Est-ce que que chaque bloc d'instructions numéroté est correcte (réponse Vrai) ou provoque une erreur de compilation (réponse Faux)

//1

Logement logement = new Logement(200,8,5);

Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на celene.univ-orleans.fr?

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