Anonymous user
Assertions in design by contract: Difference between revisions
Assertions in design by contract (view source)
Revision as of 18:50, 12 September 2017
, 6 years ago→{{header|Java}}: consistent formatting
(Added Kotlin) |
(→{{header|Java}}: consistent formatting) |
||
Line 193:
The ''-ea'' or ''-enableassertions'' option must be passed to the VM when running the application for this to work.<br>
Example taken from [[Perceptron#Java|Perceptron task]].
<lang java>(...)
▲ int feedForward(double[] inputs) {
▲ assert inputs.length == weights.length : "weights and input length mismatch";
}
return activate(
}
(...)</lang>
=={{header|Kotlin}}==
|