Current will flow only when holes and electrons recombine at the junction between p-type and n-type semiconductors (upper circuit).
Next