Ask Your Question
1

Why is it that the Wildcard instantiated List is unable to receive a value?

asked 2023-05-10 06:15:12 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-05-10 06:22:01 +0000

huitzilopochtli gravatar image

The Wildcard instantiated List is unable to receive a value because the use of a wildcard in a generic type parameter means that the type parameter can represent any type. Without specifying a specific type for the list, the compiler cannot guarantee that the value being added is of the correct type for the list, nor can it guarantee that the value extracted from the list is of the correct type. Therefore, it is unsafe to add or extract values from a wildcard instantiated list.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-10 06:15:12 +0000

Seen: 13 times

Last updated: May 10 '23