Well, if your class represents data storage objects, then it's fine to go with that. This scheme is common in java beans.
For example, if you have a class that represents an employee in the company, then this is quite common, if the employee has 20-25 attributes.
But if you confuse so many instance variables with business methods, then along the line you will encounter difficulties, since you will not be able to concentrate and focus on business components.
To make it more intelligent in architecture, you can consider Inheritance (subclass) or composition (inner class)
source share