logo

Crowdly

Browser

Add to Chrome

Which of the following statements are true? Assume that class WildAnimal...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Which of the following statements are true?

Assume that class WildAnimal and its subclass class Tiger extends WildAnimal exist.

a) Using List<? extends WildAnimal> is a case of contravariance.

b) In class List<E>, where E is a paramter type, the method add is implemented that allows to add an element of type E to the list:

void add (E elem) {…}

Can you build a concrete List (list with concretized types) for adding and storing WildAnimal objects?

c) Using List<? super Tiger> is a case of contravariance.

d) List<?> is compatible to a concrete List of any type.

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.jku.at?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome