bonsoir à tous le monde dans ce code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 test a= new test(1,"a");
    test b= new test(2,"b");
 
        LinkedList<test> dic = new LinkedList<test>() ;
        dic.add(a);
        dic.add(b);
        ListIterator<test> iter = dic.listIterator ();
        while(iter.hasNext())
{
System.out.println(((test)iter.next()).y);
}
 
        Iterator iterator=dic.iterator();
int i=0;
while(iterator.hasNext())
{
i++ ;
if(((test)iterator.next()).y.equals("b")) System.out.print("yes");
}
j'ai pas compris pourquoi on fait (test) j'ai lu que c'est le cast mais j'ai pas compris c'est quoi le cast

merci