Flash cards
Review the key moves
1/4
Core idea
What is the main idea behind Java Math sqrt() Method?
Lesson checks
Practice each idea before moving on
Short Mimo-style checks built from this lesson's code, terms, and sequence.
1Quick choice
Which statement best captures the main point of this lesson?
2Fill blank
Complete the missing token from the example code.
___.out.println(Math.sqrt(0));3Order
Put the learning moves in the order that makes the concept easiest to apply.
The sqrt() method returns the square root of a number.
Definition and Usage
Java Math sqrt() Method
❮ Math Methods
Example
System.out.println(Math.sqrt(0));
System.out.println(Math.sqrt(1));
System.out.println(Math.sqrt(9));
System.out.println(Math.sqrt(0.64));
System.out.println(Math.sqrt(-9));Definition and Usage
The sqrt() method returns the square root of a number.
Syntax
public static double sqrt(double
number )Parameter Values
| Parameter | Description |
|---|---|
| number | Required. A number to find the square root of. |
Technical Details
| Returns: | A double value representing the square root of a number. If the number is less than 0, it returns NaN. |
|---|---|
| Java version: | Any |