To ensure secure and controlled access. Frame the concept in practical terms so you can explain it during interview discussion.
Public fields can be modified directly by any part of a program, leading to potential breaches of data integrity and unintended side effects. By keeping fields private and controlling access through methods, you maintain control over how the data is used and modified. For example, making a product's inventory count public could lead to inconsistent data if modified by multiple parts of the program simultaneously.