Why does not a private method go into the documentation in Java?

2

Why does not a method have a void modifier as it does not appear in the documentation?

As soon as I put the public it appeared in the documentation. Is there any more modifier that interferes with this?

    
asked by anonymous 14.01.2018 / 00:39

2 answers

4

The documentation generator default is the -protected option, that is, only the%,%, and public classes, methods, and fields are documented. If you want documentation for all classes, methods, and fields, use the protected option. As already answered by Maniero, this has nothing to do with -private .

Documentation documentation: javadoc

    
14.01.2018 / 13:39
4

void will not change anything, it's just an indicator that the method does not produce a result.

What is private is implementation detail, something that can be changed at any time without prior notice. You can not call what is private, so not because having knowledge of how it works, you do not have to document it.

Private members can be documented with the < -private >, according to Carlos Heuberger's answer.

    
14.01.2018 / 04:33