In October 1776, at the age of 17, Wilberforce went up to St John's College, Cambridge. The deaths of his grandfather in 1774 and his uncle three years later had left him independently wealthy and as a result he had little inclination or need to apply himself to serious study. Instead he immersed himself in the social round of student life and pursued a hedonistic lifestyle, enjoying cards, gambling and late-night drinking sessions – although he found the excesses of some of his fellow students distasteful. Witty, generous and an excellent conversationalist, Wilberforce was a popular figure. He made many friends including the more studious future Prime Minister William Pitt. Despite his lifestyle and lack of interest in studying, he managed to pass his examinations and was awarded a Bachelor of Arts degree in 1781 and a Master of Arts degree in 1788.