Hi,
Below is the code I could write for the task (task01.task0127-Square of a number).
I have two errors displayed,
1> The main method should display the result of the sqr method.
2> The displayed text must match the task conditions.
So, kindly help me with the solution.
Thank You.
package com.codegym.task.task01.task0127;
/*
Square of a number
*/
public class Solution {
public static void main(String[] args) {
int result,number;
number=5;
result = sqr(number);
System.out.println("the square of 5 " + result);
}
public static int sqr(int a) {
return a * a;
}
}