There are a number of things wrong with the syntax of your code.
You should review your basic knowledge of
Java syntax and concepts first. A good place to learn the basics is
Oracle's Java Tutorials.
Here are my remarks, looking at your code:
Jennings Cavil wrote:I can't figure out why I have so many errors for my class.
Why do you have an opening brace { in line 7? Remove it.
In line 17, in the calcDistance() method, you are using variables x1, x2, y1, yt which are not declared at that point. The constructor (lines 8 - 14) does have argument variables x1, y1, x2, y2 (not yt) but these are variables local to the constructor, which are not available in other methods in the class.
You should use the member variables in the calcDistance() method instead.
You need to be really precise when writing a program. Computers are dumb machines, which get confused when you don't give them exactly what they need. Be careful that you get all the details exactly right - no extra {, use the exactly correct variable names, etc.
Besides the syntax problems, there are some things conceptually wrong with your class. Suppose you fix the syntax errors, then the class is still not very useful; the calcDistance() method assigns its result to a private member variable, but there is no way to get the result of the calculation out of the class (private member variables are not accessible outside of a class).