Search code examples
javajavadoc

Issues with JavaDoc


So I am trying to correctly and fully javadoc comment this block of code but I dont know what all to do and what not to do. Thanks !

public double largerRoot (double a, double b, double c) throws Exception
{
    double discriminant;
    double root1;
    double root2;

    discriminant = Math.sqrt ( b * b - 4 * a * c );

    if ((discriminant < 0) || (a == 0))
    {
        throw (new Exception("Math Error"));
    }

    root1 = (-b + discriminant) / (2 * a);
    root2 = (-b - discriminant) / (2 * a);

    return Math.max(root1, root2);
    }

Solution

  • in eclipse, press Alt + Shift + J

    else: google (like this)