1
How do I use two types in the method Generics, to sum only the areas of the classes Quadrado and Retangulo.
I tried a method like this:
public static double soma(Forma <? extends Quadrado> elementos) {
return elementos.getArea();
}
and Forma and abstract.
Talk more about the classes
Forma,QuadradoandRetangulo. What are their methods? The solution that I would come up with would simply not use any generic type, so I would like to see your classes to understand what these generic types are and what they represent.– Victor Stafusa