Meaning of new Class(...){{...}} initialization idiom

Viewed 10011

What does {{ ... }} block mean in the following code?

class X {

    private Y var1;

    private X() {
        Z context = new Z(new SystemThreadPool()) {{
            var1 = new Y();
        }};
    }

}
4 Answers
Related