How do I use two types in the generics method, to sum only the areas of the Quadrado
and Retangulo
classes.
I tried a method like this:
public static double soma(Forma <? extends Quadrado> elementos) {
return elementos.getArea();
}
and Forma
and abstract
.