The Data class is a simple class that holds data and provides typical functions. To declare a class as a data class, use the data keyword. A data class must have at least one primary constructor with a property parameter when declared (val or var).