This comes from the very first line of the Analerta of Confucius (
论语):
学而时习之,
不亦说乎?
有朋自远方来,
不亦乐乎? — 'To study and practice regularly, isn't that satisfying? To have friends visit from afar, isn't that joyful?' It's one of the most famous quotes in Chinese literature, and every Chinese student memorizes it.