-1
I am trying to overload the add method, but apparently this does not work with Arraylists. Confirm?
Métodos:
public int somar(ArrayList <Classe> classe){...}
public int somar(ArrayList<Filme> filmes){...}
public int somar(ArrayList<Aula> aula){...}
I didn’t find documentation most recent but generics have been introduced in the Java language to provide more rigid type checks in compilation time. To implement generics, the Java compiler applies type deletion by replacing all parameters in generic types with Object so the bytecode produced contains only common classes, interfaces and methods and consequently, generics do not generate overhead in running time.
– Augusto Vasques