I don't understand the structure(s) that we have to use here.
public class Solution {
public static void main(String[] args) {
int a = sqr(5);
System.out.println(a);//write your code here
}
public static int sqr(int a) {
return a * a;
I did this and got a right solution but I still do not understand what public static int sqr(int a) {
return a * a;
this piece does.
or how else can we solve it. Please advice.package com.codegym.task.task01.task0127;
/*
Square of a number
*/
public class Solution {
public static void main(String[] args) {
//write your code here
}
int a = 5;
public static int sqr(int a) {
return a * a;
}
}