This doesn\'t compile and gives the following error : Illegal start of expression. Why?
Illegal start of expression
public static AppConfig getInstance() { return mConf
You are trying to return a throw new RuntimeException("error"). That is why you are getting error. Because in true case you are returning AppConfig and in false case you are returning exception.
throw new RuntimeException("error")
true
AppConfig
false
exception