Should I use JavaDoc deprecation or the annotation in Java? -


there @ moment, 2 ways mark code depreacted in java.

via javadoc

/**  * @deprecated  */ 

or annotation:

@deprecated 

this problem - find bit declare both, when marking method deprecated when using eclipse. want use 1 of them.

however using annotation give compiler actual useful additional information?

but using annotation, cannot state why method deprecated - can javadoc, , deprecating method without specying why bad.

so, can use 1 of them? or should learn specify both?

you should use both. annotation allows compiler display warning whenever deprecated method used, , javadoc explains why. both important.

as per oracle's java annotations tutorial:

when element deprecated, should documented using javadoc @deprecated tag...


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -