scala 伴生对象的作用_scala伴生对象有什么用-CSDN博客文章浏览阅读5.9k次,点赞5次,收藏14次。1、什么是伴生对象scala中的类不能定义静态成员,而代之以定义单例对象来替代单例对象通过object关键字来声明单例对象中的所有方法,可以直接通过object单例对象的名字直接来调用。...... admin2024-01-23