a little java里的例子为啥写法那么奇怪

Though the book\u0026#39;s title contains Java, it\u0026#39;s not a book about Java. Under the surface, it\u0026#39;s teaching functional programming using Java.
This is the key to understanding those examples. For exmaple, the first chapter is really about Union datatype (or sum datatype) you would normally find in functional programming languages such as ML.
In this book, it doesn\u0026#39;t use any collection concepts like set, map, or list. Instead, the author teaches you to create those concepts from the very basic building blocks Java provides.
【a little java里的例子为啥写法那么奇怪】 If you are familiar with list type in haskell or ML, those examples used in the book should be quite natural.

■网友
个人觉得作者这里只是借用这些食物来表达类型的概念。这种问题还是去SF提问比较好http://stackoverflow.com/questions/35111005/class-design-in-a-little-java-a-little-pattern/


    推荐阅读