Created
September 21, 2010 10:19
-
-
Save goshki/589507 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* <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