Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1048617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:29:10+00:00 2026-05-16T16:29:10+00:00

When is it appropriate to use a block comment at the beginning of methods,

  • 0

When is it appropriate to use a block comment at the beginning of methods, and when is it appropriate to use a javadoc-style comment?

From the “Comments” section of the Java style guide, I found this:

Java programs can have two kinds of
comments: implementation comments and
documentation comments. Implementation
comments are those found in C++, which
are delimited by /*...*/, and //.
Documentation comments (known as “doc
comments”) are Java-only, and are
delimited by /**...*/. Doc comments
can be extracted to HTML files using
the javadoc tool.

Implementation comments are meant for
commenting out code or for comments
about the particular implementation.
Doc comments are meant to describe the
specification of the code, from an
implementation-free perspective. to be
read by developers who might not
necessarily have the source code at
hand.

So, another way to phrase my question would be: When do methods deserve a specification of the code, from an implementation-free perspective (Javadoc) instead of a comment about a particular implementation, and vice versa? Would an interface get javadoc comments, while the implementations get block comments?

edit: I think I am not conveying my question correctly, based on the answers thus far.

Here’s an example of what I want to know.

/**
 * Javadoc comment here about general implementation?
 */
/*
 * Should I now have a separate block comment for my specific implementation?
 */
public void foo()
{
...
}

The two different comment styles convey two different types of information. Are there cases when methods should have BOTH a leading javadoc comment, and a leading block comment?

The inspiration for even asking is that Eclipse auto-generated this for me just now:

/*
 * (non-Javadoc)
 * @see my.package#process()
 */

And I figured there is some sort of styling going on here that isn’t declared specifically in the comment specifications I link to above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:29:11+00:00Added an answer on May 16, 2026 at 4:29 pm

    Info that the user of a class needs to know should go into a Javadoc comment.

    Info that a developer modifying a class needs to know go into a normal comment (block or line).

    And it’s very possible that any block of code (class, interface, field, method, constructor, …) can have both a Javadoc comment and a normal comment block, when both publicly visible as well as internal documentaton is required.

    Personally I tend towards writing very little non-Javadoc comments, because I prefer to structure my code in a way that it’s self-documenting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The short form of this question: When, if ever, is it appropriate to use
I've found a very good article about how to use EntLib Validation Block for
Let's collect some tips for evaluating the appropriate use of global.asax.
When is it appropriate to use an unsigned variable over a signed one? What
When is it appropriate to use <cflock scope=application> or it's ilk as opposed to
When is it appropriate to use CoTaskMemAlloc? Can someone give an example?
It's possible, but is it appropriate to use SHFileOperation within a Windows service? All
What is the most appropriate media type (formally MIME type) to use when sending
In what situation would it be more appropriate for me to use a bitset
I have changed title slightly because I thought this is more appropriate question. Would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.