10
/**
*@param context
*@param attrs
*/
Public DotView(Context context, Attribute attrs) {
     super(context, attrs);
     setFocusAbleInTouch(true);
}

Does the @param serve any purpose. I saw this code in an Android programming book, but the author didn't explain what the @param meant. I know it is inside a double line comment so I am assuming @param doesn't do anything to the outcome and it is there for readability. Am I right or wrong?

JavaNoob
  • 299
  • 2
  • 5
  • 11
  • 5
    That's not an annotation. It's Javadoc. It allows you to describe a method parameter. – Steven Benitez May 22 '13 at 00:49
  • 1
    If you mean that `/** */` is ignored by Java compiler - then you are right. As pointed out, it's processed by JavaDoc utility. – PM 77-1 May 22 '13 at 01:04
  • 1
    @PM77-1 After writing a taglet, it became apparent to me that the JavaDoc utility is actually using the compiler to get its input. This is logical, it has to handle overridden methods, links to other classes etc. etc. So it is not ignored by the compiler, but the compiler of course won't convert it to Java byte code. – Maarten Bodewes May 22 '13 at 01:35

1 Answers1

10

Does the @param serve any purpose

It is part of the JavaDocs documentation system.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491