What does List<?> mean?

Prepare for your Java exam with our ultimate quiz based on 'Thinking in Java'. Engage with expertly crafted questions that enhance your learning process. Perfect for Java enthusiasts looking to solidify their knowledge!

A) A list of Objects is not the same as a list of a specific unknown type. A list of Objects allows for any type of Object to be added to the list, while List<?> only allows for a specific unknown type to be added.

B) A raw list type is not the same as List. A raw list type does not have the type specified, whereas List has a specific unknown type specified.

D) A list without any type is not the same as List. List denotes a specific unknown type, whereas a list without any type can have any type of Object added to it.

List<?> denotes a non-raw list of a specific unknown type. This means that the type of objects in the list is unknown, but the list itself is not a raw type. This allows for type safety while still being able to work with different types of objects

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy