What can I write instead of this?
boolean exceedsLimit;
if (speed > limit) {
exceedsLimit = true;
} else {
exceedsLimit = false;
}
a) The given code is correct and doesn't need any modification.
b) Use the ternary operator to simplify the code.
c) Remove the else statement for improved readability.
d) Change the if condition to exceedsLimit = (speed > limit);.