Think about it. You could do this with your code:
A a = new A();
A b = new A(); // Wrong... x is already initialised
The correct ways to initialise x are:
public class A
{
private static final int x = 5;
}
or
public class A
{
private static final int x;
static
{
x = 5;
}
}