Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a private constructor in the Utils class to hide the implicit public one. #51

Open
danielmunteanu123 opened this issue May 30, 2021 · 1 comment

Comments

@danielmunteanu123
Copy link

danielmunteanu123 commented May 30, 2021

Screenshot_20
I've used SonarQube and found this bug which is not critical but it should be fixed.
Utility classes should not have public constructors

Utility classes, which are collections of static members, are not meant to be instantiated. Even abstract utility classes, which can be extended, should not have public constructors.
Java adds an implicit public constructor to every class which does not define at least one explicitly. Hence, at least one non-public constructor should be defined.

Thank you

@aniket691
Copy link

Can i take this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants