if
Statement
if (logical-expression)
statement-executed-if-true
if (logical-expression)
statement-executed-if-true
else
statement-executed-if-false
if (x1 == x2)
{
System.out.println("**Warning x1 equals x2");
answer = 0;
}
else
{
answer = ((y2 - y1) / (x2 - x1));
}
When x1 and x2 have the same value, first the print statement is executed,
and then the assignment statement is executed.