logo

Crowdly

Browser

Add to Chrome

On donne la classe A suivante : public class A{     private ArrayList<String...

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

On donne la classe A suivante :

public class A{

    private ArrayList<String> ls=new ArrayList<>();

    

    public void ajoutElement(String s){

        if (!ls.contains(s)){

            ls.add(s);

        }

    }

    

    public ArrayList<String> obtenirListe(){

        return ls;

    }

}

On donne également le  programme p suivant :

A a=new A();

a.ajoutElement("a");

a.ajoutElement("b");

a.ajoutElement("c");

a.obtenirListe().remove("a");

System.out.println(a.obtenirListe().contains("a"));

Sélectionnez les propositions correctes :

0%
0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.umontpellier.fr?

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

Browser

Add to Chrome