How do I make my scala method static?
问题 I have a class class MyClass { def apply(myRDD: RDD[String]) { val rdd2 = myRDD.map(myString => { // do String manipulation } } } object MyClass { } Since I have a block of code performing one task (the area that says "do String manipulation" ), I thought I should break it out into it's own method. Since the method is not changing the state of the class, I thought I should make it a static method. How do I do that? I thought that you can just pop a method inside the companion object and it