If whatever was played forms a clear tonality, particularly in C major, then the boy had a big chance to match the names by accident.
If the pitches were played randomly, without shaping up a tonality, if the boy still sang the names, then he has it.