O'Reilly logo

OCP Oracle® Certified Professional Java® SE 8 Programmer II by Scott Selikoff, Jeanne Boyarsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2 Design Patterns and Principles

THE OCP EXAM TOPICS COVERED IN THIS CHAPTER INCLUDE THE FOLLOWING:

  • ✓  Advanced Java Class Design
    • Develop code that declares, implements, and/or extends interfaces and use the @Override annotation
    • Create and use Lambda expressions
  • ✓  Lambda Built-in Functional Interfaces
    • Use the built-in interfaces included in the java.util.function package such as Predicate, Consumer, Function, and Supplier
  • ✓  Java Class Design
    • Implement encapsulation
    • Implement inheritance including visibility modifiers and composition
    • Implement polymorphism
    • Create and use singleton classes and immutable classes

images

What does it mean to write good code? How do you measure code and differentiate good code from bad code? Although your previous study may have focused on learning how to develop Java code that compiles and executes properly at runtime, this chapter assumes that you already know how to do that. The primary goal of this chapter is to teach you best practices for designing Java classes and writing applications that lead to code that is easier to understand, more maintainable, and that you and other developers can leverage in future projects.

Adhering to the design principles and design patterns enables you to create complex class models that smoothly interact with other developers’ applications. The better your software application is designed, the better ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required