In object-oriented programming, a class is indeed a user-defined type that encapsulates data and behavior. Unlike primitive data types (int, float, char) which are built into the language, classes are defined by programmers to model real-world entities or abstract concepts. Classes combine data attributes and methods into a single reusable unit.