Can we add an if-else statement in a constructor?