Заключительные аргументы в методах интерфейса - в чем смысл?

In Java, it is perfectly legal to define final arguments in interface methods and do not obey that in the implementing class, e.g.:

public interface Foo {
    public void foo(int bar, final int baz);
}

public class FooImpl implements Foo {

    @Override
    public void foo(final int bar, int baz) {
        ...
    }
}

In the above example, bar and baz has the opposite final definitions in the class VS the interface.

In the same fashion, no final restrictions are enforced when one class method extends another, either abstract or not.

While final has some practical value inside the class method body, is there any point specifying final for interface method parameters?

185
задан mindas 21 March 2011 в 05:53
поделиться