kotlin static field

To declare a static field in Kotlin, you would follow these steps:

  1. Define a class where you want to declare the static field.
  2. Use the "companion object" keyword to create a companion object within the class.
  3. Inside the companion object, declare the static field using the "val" or "var" keyword along with the field name and its type.
  4. Access the static field using the class name followed by the companion object name and then the field name.

I hope this helps!