The simple difference is that, getClass() returns the XPath of the webelement. Whereas, getAttribute("class") will return the value of the class attribute within the <div> tags. Look at the code below to understand this concept better.
WebElement ele = driver.findElement(By.xpath(".//*[@id='next']"));
String a = ele.getAttribute("class");
System.out.println(a);
string b = ele.getClass();
System.out.println(b);
And if the html code was this:-
<input id="next" class="rc-button rc-button-submit" type="submit" value="Next" name="signIn"/>
Then, a will return: "rc-button rc-button-submit". Whereas, b will return: ".//*[@id='next']"
Hope the explanation was clear.