logo

Crowdly

Programmation Java et IHM

Looking for Programmation Java et IHM test answers and solutions? Browse our comprehensive collection of verified answers for Programmation Java et IHM at cours.cyu.fr.

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

Que se passe-t-il si une classe abstraite possède un constructeur ?

100%
0%
0%
0%
View this question

Comment empêcher une classe d’être héritée en Java ?

100%
0%
0%
0%
View this question

class A {

    int x = 10;

    void afficher() {

        System.out.println("A");

    }

}

class B extends A {

    int x = 20;

    void afficher() {

        System.out.println("B");

    }

}

public class Test {

    public static void main(String[] args) {

        A obj = new B();

        System.out.println(obj.x);

        obj.afficher();

    }

}

0%
100%
0%
0%
View this question

Quelle est la différence entre une classe abstraite et une interface après Java 8 ?

0%
0%
100%
0%
View this question

class Parent {

    static void afficher() {

        System.out.println("Parent");

    }

}

class Enfant extends Parent {

    static void afficher() {

        System.out.println("Enfant");

    }

}

public class Test {

    public static void main(String[] args) {

        Parent p = new Enfant();

        p.afficher();

    }

}

100%
0%
0%
0%
View this question
Soit le code suivant:

public interface Max {

       public double max(

);

       public int

nombreElements

œuf;

}

public final interface

Stats extends Max{

       public double somme(

);

}

public class Groupe

extends Stats {

    private double[] valeurs = {3.2, 8.5,

6.1, 1.5, 2.8};

     public double maxœuf {

            double maximum = valeurs[0];

            for(int i=1; i < valeurs.length; i++) {

                if

(valeurs[i] > maximum) maximum = valeurs[i];

            }

            return maximum;

    

     public double sommeœuf {

            double accum = 0.0;

            for(int i=0; i < valeurs.length ; i++)

               

accum+=valeurs [i];

            return accum;

     }

     public double get(int index) { return valeurs[index]; }

     public static void main(String[] args) {

            Groupe mmGroupe = new Groupe();

            System.out.println("Max mmGroupe " +

mmGroupe.max

œuf );

            System.out.println("somme mmGroupe " +  ((Stats) mmGroupe).somme());

            System.out.println("dernier element " +

mmGroupe.get(7) );

     }     

}

a) Dans le code, il y a quatre erreurs, trouvez-les. Justifiez votre réponse.

View this question

Que se passe-t-il si une classe hérite de deux classes en Java ?

0%
100%
0%
0%
View this question

Want instant access to all verified answers on cours.cyu.fr?

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