In my code i am using two different class objects empobj & employee.
Eclipse asks to change the code
empobj.addAll(employee);
to
empobj.addAll((Collection<? extends EmpApp>) employee);
What does it mean?
I cannot understand the concept here.
Can I get any clarifications about this?
addAlltakes as its parameter aCollectionand then adds all the elements of that collection to itself. In your case, you’re trying to give it something that is not aCollection, so the compiler is trying to make it work by casting the argument to the correct type. In this particular case, the correct type is a collection of some object which extendsEmpApp, i.e.,Collection<? extends EmpApp>.Judging from the name of your variable,
employeeprobably isn’t a collection, so you need to revisit the API for whatever collectionempobjis and find out how you can add a single element to it (likelyadd).