Question: expression must have class type?
Answer: The “expression must have class type” is an error that is thrown when the . operator, which is typically used to access an object's fields and methods, is used on pointers to objects. ... These fields or methods are part of an object, rather than a part of the pointer to an object.