Difference between {} and {{}} initialization in Java
<pre><code>public class A{
}

A a = new A(){{
    final int x = 1; // IT HAS TO BE FINAL HERE. WHY?
}};

A aa = new A(){
    int x = 1; // THIS NEED NOT BE FINAL. WHY?
    final int y = 1; // STILL FINAL IS ALLOWED HERE. WHY?
    public int getX(){
        return x;
    }
};
</code></pre>

<p>Can somebody please answer the questions mentioned inside the snippet?</p>

<p>Thanks</p>
