Square a number
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
Square a number
Return n * n. Java is strict about types, so square is declared to return an int and your value must match.
Complete square(int n) so it returns n * n. Do not write main — the checker calls your method.
Click Run to see the output here.