Here's how my program works. 

I start by creating it:

-bash-4.1$ pico -w Three.java

I then compile it:

-bash-4.1$ javac Three.java

I run it:

-bash-4.1$ java Three
Enter number: 2
1.4142135623730951 squared is 2.0

It prompts me for a number. 

I gave it a 2. 

It prints back the square root. 

-bash-4.1$ java Three
Enter number: 3
1.7320508075688772 squared is 3.0

I tried another number: 3. 

It reports the square root of 3. 

-bash-4.1$ java Three
Enter number:
Exception in thread "main" java.lang.NumberFormatException: empty String
        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1011)
        at java.lang.Double.parseDouble(Double.java:540)
        at Three.main(Three.java:8)

If the user does not type a number in response I am not responsible for the program's behavior. 

-bash-4.1$ java Three
Enter number: bye
Exception in thread "main" java.lang.NumberFormatException: For input string: "bye"
        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1241)
        at java.lang.Double.parseDouble(Double.java:540)
        at Three.main(Three.java:8)
-bash-4.1$

That's it. 

--