Here is my task:
Create a class named MyTriangle that contains the following two methods:
/** Return true if the sum of any two sides is *
So you write the following: if the input is valid, show error message. Otherwise (else) compute area. You should just swap your if and else parts! Your program never calls the area() method if you are calling it with points for a valid triangle. Moreover, you never call the isValid() method. You assign true to the variable, and then check it in the next line, but the method that actually checks it has never been called.
ALSO you need side variables for isValid(), but you only compute them in the area() method. You should compute them right after you get the points.