Welcome to the Treehouse Community
Looking to learn something new?
Why the answer is all of those?
Hi, i dont understand why the answer is all of theseto the question: Which of these objects can we pass in to the logPresentr method?
Is it because <P> extends Object?, like <T>? Tonnie Fanadez
Tonnie FanadezUX Design Techdegree Graduate 22,793 Points
It should be all of them.
Just remember in Java we can define our own classes type and give them whatever name we can think of. Sock is-a(n) Object because it extends/inherits from Object Class. Chocolate Class is-a Object. A collection of Amazon Gift Cards is also an Object since a Gift Card Type is-a child of the Object Super-class.
In short *All Java Class Types * inherit their properties from the Object Class.
In return Objects of the same type can be grouped together using Collections (*Lists, Sets, Maps or Queues *).
In Collection<T> T is just a placeholder and any child of Object Class can be inserted in between the diamond brackets.
Hi Tonnie Fanadez how are u? So am i right with my question or no?, <P> is like <T>, <P> its a placeholder and any child of Object?
btw How's the techdegree, what u learn there?