logo

Crowdly

Browser

Add to Chrome

R2.01 Developpement Objets

Looking for R2.01 Developpement Objets test answers and solutions? Browse our comprehensive collection of verified answers for R2.01 Developpement Objets at celene.univ-orleans.fr.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

    //10

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

        super(superficie, nbPiece, identifiant);

        this.numEtage = numEtage;

    }

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

0%
100%
View this question
//7 public void affiche(){ System.out.println("Superficie :"+this.superficie+", Nombre pièces :"+this.nbPieces); }

0%
0%
View this question
//8 public Maison(int superficieJardin){ super(100,4,0); this.superficieJardin = superficieJardin; }
100%
0%
View this question
//6 public Logement(int superficie, int nbPieces, int identifiant){ this.superficie = superficie; this.nbPieces = nbPieces; this.identifiant = identifiant; }

0%
0%
View this question

//5 appartement.affiche();
0%
100%
View this question
//4 maison.affiche();
100%
0%
View this question
//3 Logement maison = new Maison(100);

0%
0%
View this question
//2 Appartement appartement = new Appartement(50, 2, 6, 2);

100%
0%
View this question

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);

0%
100%
View this question

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

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

Browser

Add to Chrome