**Square root:**

```
double x = 9;
x = Math.sqrt(x); //3.0
```

**Nt root:**

```
double num = 8;
double root = 3;
double x = Math.pow(num, 1.0 / root);
System.out.println(x); // 2.0
```

**Square root:**

```
double x = 9;
x = Math.sqrt(x); //3.0
```

**Nt root:**

```
double num = 8;
double root = 3;
double x = Math.pow(num, 1.0 / root);
System.out.println(x); // 2.0
```