mercredi 20 octobre 2021

How can I simplify this if statement?

Basically, I am doing a java program for school. The checkstyle program we are required to use is saying that I am not simplifying my if statement enough. Is there a better way to do this?

My code:

    if (check() == true)
    {
        return amount * 0.85;
    }
    else
    {
        return amount;
    }

Aucun commentaire:

Enregistrer un commentaire