Hey folks! From the little I have learned about interfaces so far, aren't they inherently public?
"All abstract, default, and static methods in an interface are implicitly public , so you can omit the public modifier." (from Oracle Docs)
Is public really necessary?
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Ntuthuko Xaba
5 April 2020, 23:54useful
I think the first reason you have to declare them in - Abstract Classes, is so that you are able to @Override them with the same signature.Since the methods will probably be public in the classes , I would guess it's best practise to declare them as such initially.
The second reason I would guess is to comply with CodeGym conditions. You will see when you get to the HenFactory task , to what degree you actually have to comply with CodeGym conditions.
+1