mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-23 04:20:16 +08:00
style: enable ParameterName
in CheckStyle. (#5196)
* Enabled: ParameterName in CheckStyle. * Refactored to fix bug caused by selfAssignment of variables in VectorCrossproduct class
This commit is contained in:

committed by
GitHub

parent
2568b96784
commit
c42b1c940c
@ -12,7 +12,7 @@ public final class NewManShanksPrime {
|
||||
private NewManShanksPrime() {
|
||||
}
|
||||
|
||||
public static boolean nthManShanksPrime(int n, int expected_answer) {
|
||||
public static boolean nthManShanksPrime(int n, int expectedAnswer) {
|
||||
int[] a = new int[n + 1];
|
||||
// array of n+1 size is initialized
|
||||
a[0] = 1;
|
||||
@ -22,7 +22,7 @@ public final class NewManShanksPrime {
|
||||
a[i] = 2 * a[i - 1] + a[i - 2];
|
||||
}
|
||||
// The loop is continued till n
|
||||
return a[n] == expected_answer;
|
||||
return a[n] == expectedAnswer;
|
||||
// returns true if calculated answer matches with expected answer
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user