the cube method takes a and turns it into a= a*a*a
so why cant the ninthDegree method take a and return it as a = (cube a) * (cube a) * (cube a) ?
instead, it's some random statement that is not even explained how or more importantly why it works.
package en.codegym.task.pro.task06.task0609;
/*
A cubed cube calculator
*/
public class Solution {
public static void main(String[] args) {
}
public static long cube(long a) {
return a * a * a;
}
public static long ninthDegree(long a){
return cube(a) * cube(a) * cube(a);
}
}