final double X ;
public static void main(String arg2)
variable X not initialized in the default constructor
final double X;
final class variable
final fields must be initialized in all the constructors of your class otherwise you get a compilation error. Moving
final double X; inside
main(), is a totally different concept as it will then be a local variable whose value cannot be modified.