Why should some software metrics be kept private provide one
Why should some software metrics be kept “private”? provide one example of metrics that should be private and one metrics that should be public.
Solution
when we kee some metrics as private the non member functions or the functions derived from it cannot access its internal methods unless and until it is friend of the metric which is private.we do this to save the essential and important data ,which should not be shared with the outside world .we also do ths to protect the internal data from tampering or modification from non related people or outside world.
when we want to share the data or any metric with everone like derived classes,non member functions etc,we must keep it public.
ex: internal variales of class must be kept private
some functions like adding data can be kept public
