Day 4
Beyond Classes
- Implementing Interfaces
- Declaring and Using an Interface
- Extending an Interface
- Inheriting an Interface
- Inserting Implicit Modifiers
- Declaring Concrete Interface Methods
- Working with Enums
- Creating Simple Enums
- Using Enums in switch Statements
- Adding Constructors, Fields, and Methods
- Sealing Classes
- Declaring a Sealed Class
- Compiling Sealed Classes
- Specifying the Subclass Modifier
- Omitting the permits Clause
- Sealing Interfaces
- Reviewing Sealed Class Rules
- Encapsulating Data with Records
- Understanding Encapsulation
- Applying Records
- Understanding Record Immutability
- Declaring Constructors
- Customizing Records
- Creating Nested Classes
- Declaring an Inner Class
- Creating a static Nested Class
- Writing a Local Class
- Defining an Anonymous Class
- Reviewing Nested Classes
- Understanding Polymorphism
- Object vs. Reference
- asting Objects
- The instanceof Operator
- Polymorphism and Method Overriding
- Overriding vs. Hiding Members
Lambdas and Functional Interfaces
- Writing Simple Lambdas
- Looking at a Lambda Example
- Learning Lambda Syntax
- Coding Functional Interfaces
- Defining a Functional Interface
- Adding Object Methods
- Using Method References
- Calling static Methods
- Calling Instance Methods on a Particular Object
- Calling Instance Methods on a Parameter
- Calling Constructors
- Reviewing Method References
- Working with Built- in Functional Interfaces
- Implementing Supplier
- Implementing Consumer and BiConsumer
- Implementing Predicate and BiPredicate
- Implementing Function and BiFunction
- Implementing UnaryOperator and BinaryOperator
- Checking Functional Interfaces
- Using Convenience Methods on Functional Interfaces
- Learning the Functional Interfaces for Primitives
- Working with Variables in Lambdas
- Listing Parameters
- Using Local Variables inside a Lambda Body
- Referencing Variables from the Lambda Body