2026-03-22 08:11 浏览次数 19
密封类
we’ll learn one technique that helps when we discuss sealed class hierarchies in the section called 「sealed class hierarchies」 in chapter 7, the scala object system.
我们会在《第7章- scala对象系统》的「完成类(sealed class)结构」讨论完成类的结构时学习到其中一种技术。
because they can never be used as a base class, some run-time optimizations can make calling sealed class members slightly faster.
由于密封类从不用作基类,所以有些运行时优化可以使对密封类成员的调用略快。