1import java.lang.Math;
2import java.util.Scanner;
3
4public class HelloWorld {
5 public static void main(String[] args) {
6 class ResultNumberShape {
7
8 double number;
9
10 public boolean isSquare(double number) {
11
12 double result = Math.sqrt(number);
13 return ((result - Math.floor(result)) == 0);
14
15 }
16 }
17
18 ResultNumberShape checkNumber = new ResultNumberShape();
19
20 System.out.println("Enter any number:");
21 Scanner scanner = new Scanner(System.in);
22 double num = scanner.nextDouble();
23
24 scanner.close();
25
26 if (checkNumber.isSquare(num)) {
27 System.out.println(num + " is a sqaure number!");
28 } else {
29 System.out.println(num + " is not a square!");
30 }
31
32 }
33}
34