It's no surprise that this one pops up often in Scala interview questions for Spark.   Scala doesn’t have a static keyword to define the object-independent methods. We can directly define them in a singleton object. Otherwise, we can use a companion object for a given class to hold those methods. For example, we can create a List in Scala in the following way, val l = List(1, 2, 3, 4) This is possible as there is a method named apply defined in the object - List .