Protected access in Java should be used very sparingly

Alonso Del Arte
5 min readApr 2, 2024
Photo by Tiard Schulz on Unsplash

Yesterday I was reviewing a Java program of mine that I’ve been working on a few years now. A friend of mine, who is quite proficient with Swift, asked me about the protected access level in Java.

In that very moment I realized that my choice of access level all those years ago had been wrong, and also that following the single responsibility principle generally leads to…

--

--

Alonso Del Arte

is a Java and Scala developer from Detroit, Michigan. AWS Cloud Practitioner Foundational certified