You do not fix it - you will use another technic:
public class MyClass{
private String test = "it works";
public MyClass(){
this.startTheFun();
}
private void startTheFun(){
System.out.println(test);
}
public void main(String[] args){
new MyClass();
}
}