logo

Crowdly

Browser

Add to Chrome

Quelle est la sortie console du programme suivant ? fun buggyAbs(x: Int): Int ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Quelle est la sortie console du programme suivant ?

fun buggyAbs(x: Int): Int {

var r = x

if (x < 0) {

r = x

}

check(r >= 0) { "negatif" }

return r

}

fun main() {

try {

println(buggyAbs(-2))

} catch (e: IllegalStateException) {

println("CHECK: ${e.message}")

}

}

More questions like this

Want instant access to all verified answers on moodle.iut-tlse3.fr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome