Even though It's not obvious how to reinforce a direct member accessibility like foo.num = num, You can easily augment your traditional setter with an extra drive parameter: Fields are the one mechanism the best way to keep information on class level. Fields are conceptually variables at class scope. In https://conscientparqgurugram.in/conscient-parq-sector-80-gurgaon-a-refined-lifestyle-amidst-urban-grandeur/