logo

Crowdly

class A {     int x = 10;     void afficher() {         System.out.println("A");...

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

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%
More questions like this

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

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