Data Class

A data class is a class that only contains fields and lacks behavior. While not inherently bad, they can sometimes indicate that the class should encapsulate behavior related to its data.

Code :

Treatment:

Add methods to the class to encapsulate behavior.