The Prince and Princess of Wales on Thursday heard about solar-powered autonomous boats and low-carbon cement at a green technology startup incubator in suburban Boston before learning how a nonprofit gives young people the tools to stay out jail and away from violence.