mercredi 18 août 2021

converting conditional If-else to Java 8 Optional [closed]

I would like to convert typical if-else statement into java-8 code. Example:

if(helperMethod(someString)){
        someMethod()
  }
else{
     someOtherMethod();
}
}
public boolean helperMethod(){
/* helper method implementation - return boolean
}

Aucun commentaire:

Enregistrer un commentaire