Summary

In this chapter, you saw how switch expressions have enhanced the traditional switch statement. You can use switch expressions to return a value that can be used to initialize variables or reassign values to them. It also makes your code less verbose. By removing default fall through of the control across switch branches, you are less likely to introduce logical errors with switch expressions. 

In the next chapter, we'll cover multiple improvements and additions in JDK 12.

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

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