William, 35, surprised students at a school in London where he spoke about the challenges they face growing up in the internet era.