Question for the group; when I decompile a class f...
# announcements
g
Question for the group; when I decompile a class file of a simple object declaration, all the fields are static. Is that how it is meant to be? It seems wrong. e.g.
Copy code
object MyObject {
  val x: Int = 0
}
produces:
Copy code
public final class MyObject
{
  private static final int x = 0;
  public static final MyObject INSTANCE;
  
  static
  {
    new MyObject();
  }
  
  private MyObject()
  {
    INSTANCE = (MyObject)this;
  }
  
  public final int getX()
  {
    return x;
  }
}
Note the
private static final int x = 0;
and then the getter method