This example explains the said statement.
Methods must be public and static, with an int return type.
Method main is not involved in testing.
Requirements:
The Solution class must have public static sqr(int) method, which returns a square of a number (type int).
The Solution class must have public static cube(int) method, which returns a cube of a number (type int).
public class Solution {
public static int sqr(int num){
return num * num;
}
public static int cube(int num){
return num * num * num;
}
public static void main(String[] args) {
int number = 3;
System.out.printf("%d - %d - %d", number, sqr(number), cube(number));
}//write your code here
}