Lambdas in the classical Operation enum example

前端 未结 4 2121
长情又很酷
长情又很酷 2020-12-01 05:16

As many of you may know, there is a classical example of the Operation enum (using Java 8 standard interface now though), that is the following:



        
4条回答
  •  伪装坚强ぢ
    2020-12-01 06:01

    Define worse, most likely it uses a little more byte code and is slightly slower.

    Unless these are important to you, I would use the approach you find clearer and simpler.

提交回复
热议问题