You need to use a comparative operation between the square of the num and square. The alternative (IMO better) would be to square the square and compare that to the num.
For primitives, you can use direct comparisons. See this tutorial for more information:
http://docs.oracle.com/javase/tutori...bolts/op2.html
And for mathematics, see the Math class in java.lang.Math here:
http://docs.oracle.com/javase/6/docs...lang/Math.html
Note the accepted types and most particularly the return types of both the sqrt and the pow functions to make your comparisons. This is why I suggest comparing the square of your square instead of the square root of your number. Doing the square of your square guarantees an even integer cast on the result (for which you can even do a simple square * square as these are both integers already), whilst going the other way results in a double, even if the result is evenly divisible. So doing
(int)x * (int)x is equivalent to doing
(int)Math.pow(x, 2);.