Assertion

Report a typo

How does the assert keyword work in the following example:

double sqrt(double x) {
    assert (x >= 0) : "Invalid argument";
    return Math.sqrt(x);
}
Select one option from the list
___

Create a free account to access the full topic