import java.util.ArrayList;
import java.util.List;
public class MethGen {

    public <E> void affiche(List<E> l) {
        for (E e : l) System.out.println(e);
    }
    public static<E> int longueur(List<E> l) {  // méthode statique
        return l.size();
    }
    public <E> MethGen(List<E> l) { }          // constructeur

    public static<E> List<E> listeVide() {
        return new ArrayList<E>();
    }

    public static void main(String[] args) {
        List<Number> lst = new ArrayList<>();
        lst.add(1); lst.add(2.0);
        System.out.println(longueur(lst));
    }
}

