Tag: companion object

Static Methods, Companion Objects, and Testing

A companion object sits inside a class definition and houses all the static methods which that class will own. Let’s convert a piece of Java code to Kotlin so you can see what I mean.