BEST visibility for your JAVA classes?

preview_player
Показать описание
Your IDE likes to make everything public. Your classes, your methods, everything. But is that the BEST? What about private? Protected?

Find out the BEST way to build classes from now on!

====
====

ALSO SEE: 👀

RESOURCES: 👇

GET MORE: 🎉

Click "subscribe" under the video (and hit that bell icon) to get notified when new videos come out.

STUFF I LIKE TO USE: 😍

DISCLOSURE: All opinions stated here are mine and do not necessarily reflect those of the Spring team nor of my employer. Any usage of "Spring", "Spring Boot", "Spring Framework", "VMware", "Pivotal", or anything else is completely unaffiliated with its owners. From time to time, I may post affiliate links for products I enjoy using. They don't cost you anything extra, and I may get a small commission.

#springbootlearning #shorts

© 2023 Greg L. Turnquist, All Rights Reserved
Рекомендации по теме
Комментарии
Автор

Great advice!

Beside classes and methods, what about interfaces, enums, and records?

Should they have default visibility too? Thanks!

andyl.
Автор

Thanks! Dont u think that it is better to set visibility to as strict as possible? private as the default and only expose something when you need to. Because after you expose anything, there is no going back :)

ivankulaga