In the following (simplified) code, the compiler shouts at the add method (cannot be applied), as explained well in Jon Skeet's answer. Is there a clean way to assign my extended class onto the generic array?
class a {}
class b extends a {}
ArrayList<? extends a> arr;
void f() {
arr.add(new b());
}