dimanche 9 août 2020

Why else statement is executed after an if statement that is true and contains return statement?

Why in the following code, although if statement is evaluated as true (checked via debug), else statement also happened?

The code:

 public boolean layoutDependsOn(CoordinatorLayout parent, AppBarLayout child, View dependency) {
    if (dependency instanceof NestedScrollView)
    {
        return true;
    }
    else
    {
        return false;
    }

Aucun commentaire:

Enregistrer un commentaire