To get a square root of a number in Java, do this:
Math.sqrt(number).Here's how you do it:
double squareRoot = Math.sqrt(4);
System.out.println(squareRoot); // 2.0

Math.sqrt(number).Here's how you do it:
double squareRoot = Math.sqrt(4);
System.out.println(squareRoot); // 2.0