Elye - A One Eye Dev By His Grace
1 min readAug 25, 2020

--

Agree. Private is set not to have getter and setter. Encapsulation is the avoid external object access internal value that should be hidden.

In my text, it is referring to the case where your variable value to be accessed (e.g. get and set) externally, do you make them public or still keep them private, and make function to get and set them only? If it is just a data object class, do we still keep them private with only getter and setter?

--

--

Elye - A One Eye Dev By His Grace
Elye - A One Eye Dev By His Grace

Written by Elye - A One Eye Dev By His Grace

Sharing Software Learning, Life and Faith Journey

No responses yet