What does List<?> mean?

Dive into the depths of Java with our quiz based on "Thinking in Java, Fourth Edition" by Bruce Eckel. Test your knowledge, solidify concepts, and prepare for certification with challenging questions and insightful feedback.

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