Skip to content

Instantly share code, notes, and snippets.

@goshki
Created September 21, 2010 10:19
Show Gist options
  • Save goshki/589507 to your computer and use it in GitHub Desktop.
Save goshki/589507 to your computer and use it in GitHub Desktop.
/**
* <p>
* What's the point (if there is any) and logic behind using/non-using "final" keyword for parameters in interface method and/or
* its implementation?
*/
public class Test {
// Example 1:
public static interface I {
void perform( final Boolean b ); // final on b
}
public static class C implements I {
public void perform( Boolean b ) { // no final on b but no error
}
}
// Example 2:
public static interface I2 {
void perform( Boolean b ); // no final on b
}
public static class C2 implements I2 {
public void perform( final Boolean b ) { // final added, no error either
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment