An object might have a classattribute which should be a character vector. If this attribute is present, it contains the names of the classes from which this object inherits.
This value tells various R methods what to do with the variable (for example plot).
class prints the vector of names of the class attribute.