Method comments and annotations... where should each go?
comments, java, javadoc
Solution
First one. The annotation applies to the method, not the comment. It's also what most IDEs will do, so is the most common anyway.
Problem
So, lets say I have a method that contains an annotation like so: ``` @Override public void bar(String x) ``` If I were to add Javadoc comments to this snippet of code, which is the preferred method? Either: ``` /** * @param x A string lol */ @Override public void bar(String x) ``` Or: ``` @Override /** * @param x A string lol */ public void bar(String x) ```