DEV Community

Discussion on: What is the difference between public, protected, and private in Java?

skittishsloth profile image
Matthew Cory

One thing I'll add is that you should be able to test the private logic via the public interface anyways. IOW, if you can get complete coverage of your public interface and your private logic isn't tested, then you either don't really have full coverage or your private logic isn't accessible anyways (and get rid of it).