Search the courses, subjects, tracks, games and features, or jump straight to a page.
5 cards from this section. Quick, good the night before a test.
What is the main advantage of using Generics in Java?
Think of runtime errors related to types.
Why is it preferable to declare a List as List instead of ArrayList?
Consider what happens when the implementation changes.
What is the primary purpose of using Generics in Java?
Think about errors you want to avoid.
True or False: Using raw types can lead to ClassCastException.
Consider what raw types actually do.
Write a generic method to find the maximum element in an array of any type.
Consider how you would compare different elements.
Given a List of strings, write a function that uses Streams to convert all elements to uppercase.
Think about the mapping function and how streams work.
7 more questions in this section. Enroll free to practise them all.
Enroll free