Skip to content

Instantly share code, notes, and snippets.

Created March 19, 2018 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/768f211a47da9cb3b72c93d4a79e2ec9 to your computer and use it in GitHub Desktop.
Save anonymous/768f211a47da9cb3b72c93d4a79e2ec9 to your computer and use it in GitHub Desktop.
class NewRoot2
{
public static void main(String[] args)
{
/* The main() method puts all arguments in an array of strings, here named
arguments. The first argument is stored in array element arguments[0].
Calling the method Integer.parseInt() with that element creates an
integer value from a string. */
int number = Integer.parseInt(arguments[0]);
System.out.println("The square root of "+number+" is "+ Math.sqrt(number));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment