The judge allows both parties to be heard before notice is officially taken, and the jury is then instructed to take such evidence as fact.
An attorney, prosecuting party, or defendant cannot anticipate what evidence they may wish to enter in court until the trial is already under way.