Most UML tools represent an empty UML class with empty fields for both, attributes and operations. But looking at the UML Infrastructure and Superstructure, there are a lot of empty classes shown as one single rectangle including the name of the class. But I cannot find a clear statement which of both representations is absolutly correct.
So which graphical representation is correct - both or just one of them - and where is your information coming from?
Though @JimL's answer is correct, here is the section from Superstructures 2.5 that explains the use of compartments:
The model in Figure B.6 specializes UMLDiagramElement and UMLShape into UMLCompartmentableShape and UMLCompartment, respectively, to make them concrete, add properties, and redefine inherited properties for shapes with segregated contents.
UMLCompartmetableShape is the most general class for UML elements that may have information shown in separated portions inside their shapes, usually arranged linearly and separated by solid lines (compartments). It subsets ownedElement from UMLDiagramElement to specify compartments that are to appear vertically ordered (first in order is shown at the top), where are captured with UMLCompartment. UMLCompartment subsets ownedElement from UMLDiagramElement to specify contents of compartments that are to appear vertically ordered (first in order is shown at the top). UMLCompartments have no modelElements.
Compartment titles shall be interchanged as UMLLabels with no modelElements, and as the first orderedElement of UMLCompartments.
It means that you can show from zero to N
compartments.