mardi 27 novembre 2018

best structure of if else statement android

Please help me to reduce this code.

if (mOptionTitle.contentEquals("demo")) {
    if (book.isOn()) {
        onVisibilityHandling();
    }
    else {
        offVisibilityHandling();
    }
}
else if (Option.getIndex() == 0) {
    onVisibilityHandling();
}
else {
    offVisibilityHandling();
}

Aucun commentaire:

Enregistrer un commentaire