Charles Scalfani
1 min readJul 24, 2016

--

To be pedantic, Java objects are passed by reference and those references are passed by value. In either case, access is NOT protected and therefore Encapsulation is violated.

Also, as I’ve said in other comments, there is no reason for Encapsulation if you’re going to allow anyone to change the data. Encapsulation is only useful if used to protect private state from public mutations.

--

--

Charles Scalfani
Charles Scalfani

Written by Charles Scalfani

Software Engineer and Architect, Teacher, Writer, Filmmaker, Photographer, Artist…

Responses (3)