为什么final修饰的i可以通过构造方法赋值两次
public class Test01 {
public static void main(String[] args) {
A a = new A ();
A s = new A(8);
}
}
class A {
final int i;
public A(){
this.i = 5;
System.out.println(i);
}
public A(int a){
this.i=a;
System.out.println(i);
}
}
5
8
Process finished with exit code 0