My workmate always tells me that if we declare anything as "public" then it is dangerous because then any program can access that memory and that the solution is to use the "private" access modifier.
I am wondering if this is infact true.
That is not, in fact, true.
Access modifiers are only there to help organize your code. They only protect it in the sense that you protect your glass from being knocked over by setting it out of reach of the cat.