package fengke.finalandstatic; /** * final的误区 * @author 锋客 * */ public class FinalParma { public static void main(String[] args) { MyClass_1 myClass = new MyClass_1(); StringBuffer buffer = new StringBuffer("hello"); myClass.changeValue(buffer); System.out.println(buffer.toString()); } } class MyClass_1{ //final没有任何作用,不会影响方法体内的操作 void changeValue(final StringBuffer buffer) { buffer.append("world"); } }