The class and object can have the same name, as we will see in the section called "Companion Objects" in Chapter 6, Advanced Object-Oriented Programming in Scala.
类和object可以使用同样的名字,就像我们会在《第6章- Scala高级面向对象编程》的“伴随实体”章节中看到的那样。
The companion component class provides heroes, adds new heroes into the array, and can reset the array.
和模板相伴的组件类可以提供英雄数组,能把新的英雄添加到数组中,还能重置英雄数组。
When she saw Fang Hongjian in a second class cabin, who seemed alright, he became an amiable travel companion.
她看方鸿渐是坐二等的,人还过得去,不失为旅行中消遣的伴侣。
应用推荐