Summary

In this chapter, we covered using the reserved type var with implicitly-typed lambda expressions. We started by identifying the syntax differences in explicitly-typed and implicitly-typed lambda expressions.

Through examples, you saw how adding var to lambda parameters is just syntactic sugar, since you have been able to use type inference with implicitly-typed lambda parameters ever since they were introduced in Java 8. Using var with lambda parameters aligns their syntax with the local variables defined using var. Using var also enables developers to use annotations with lambda parameters.

In the next chapter, we'll work with the HTTP Client API, which will be added to Java 11 as one of its core APIs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.164.141