Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is type inference?
Think about how Java helps us avoid writing types explicitly.
Can you use type inference with primitive types?
Remember the limitations mentioned in the section.
What does type inference allow the compiler to do?
Think about the benefits of reducing verbosity.
True or False: Type inference can be used with primitive types.
Consider the limitations of generics.
Create a generic method similar to singletonList that returns a set containing a passed element. Demonstrate how type inference works when calling this method.
Think about how the return type is determined from the argument passed.
Discuss how type inference affects method overloading in Java when using generics. Provide examples.
Consider scenarios where ambiguity arises.
5 more questions in this section. Enroll free to practise them all.
Enroll free