Java Code:

public class MyApplication extends Application { public void init() { // Not allowed: an exception will be thrown Stage myStage = new Stage(); } ... }