float f = 0.1; // 0.100000001490116119384765625 double d = 0.1; // 0.1000000000000000055511151231257827021181583404541015625
”A rose by any other name would smell as sweet,” but main by any other name would not. Just because a method has the name “main”, that doesn’t make it the entry point to an application. It must also have the correct signature. Specifically, it must be public static void and accept a single String []
as an argument.
This rule verifies that single-line comments are not located at the ends of lines of code. The main idea behind this rule is that in order to be really readable, trailing comments would have to be properly written and formatted (correct alignment, no interference with the visual structure of the code, not too long to be visible) but most often, automatic code formatters would not handle this correctly: the code would end up less readable. Comments are far better placed on the previous empty line of code, where they will always be visible and properly formatted.