In this example we will show you how to use math.sqrt(x) to return the square root of x in Java.
Source Code
package com.beginner.examples;
public class Sqrt {
public static void main(String[] args) {
System.out.println(Math.sqrt(16)); // return the square root
}
}
Output:
4.0