2.修饰方法
public class FinalExample { public final void sayHi() { System.out.println("Hi~"); } }
3.修饰变量
public class FinalExample { private static final String MSG = "hello"; //...... }
4.修饰参数
public class FinalExample { public void sayHi(final String name) { System.out.println("Hi," + name); } }