Chapter 13Generics and Collections

THE OCP EXAM TOPICS COVERED IN THIS PRACTICE TEST INCLUDE THE FOLLOWING:

  • Generics and Collections
    • Create and use a generic class
    • Create and use ArrayList, TreeSet, TreeMap, and ArrayDeque objects
    • Use java.util.Comparator and java.lang.Comparable interfaces
    • Collections Streams and Filters
    • Iterate using forEach methods of Streams and List
    • Describe Stream interface and Stream pipeline
    • Filter a collection by using lambda expressions
    • Use method references with Streams
  1. Which of the following can fill in the blank to make the code compile?

    public class News<________> {}
    • ?
    • News
    • Object
    1. None of them
    2. I

Get OCA / OCP Java SE 8 Programmer Practice Tests now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.