Formatting:
final
, enums, and interfaces.double
over float
.@overrides
whenever possible.Math:
// Good
public double getPerimeter() {
return (2.0 * Math.PI * this.radius);
}
// Bad
public double getPerimeter() {
return (Math.PI * 2.0 * this.radius);
}
Math
library’s Pow
function.Pow
if the exponent is 3 or greater.