final表示最终的结果,不能被改变。
final可以修饰实例域、静态域、类、方法、方法变量、方法中的变量。
final修饰的实例域、静态域,必须在类初始化的时候赋值,可以通过构造函数、初始化块的方式实现,并且不能被修改。
final修饰的类不能被继承。
final修饰的方法不能被重载。
final修饰的方法变量,不能在方法中被修改。
final修饰的方法中的变量,只能被赋值1次。
接口中的域会被默认设为final。