Hello great programmers at this website. Hopefully your day has been good so far. I was wondering if you could help me with some Java errors related to the header of my program that I am doing for an assignment. Thank you millions for your help. Here is the code:
import java.Math.*;
import java.swing.JOptionPane;
public class EqTri
{
private double sideLength;
private String identifier;
{
public EqTri(double x,String s)
{
sideLength= x;
identifier=s;
}
public setsideLength(double x)
{
x= sideLength;
}
public setIdentifier(String s)
{
s= identifier;
}
public double getsideLength()
{
return x;
}
public String getIdentifier()
{
return s;
}
public double getPerimeter()
{
return 3*s;
}
public double getArea()
{
return (Math.sqrt(3)/4)*a*a;
}
}
Here are the errors that came, for your convenience:
EqTri.java:9: illegal start of expression
public EqTri(double x,String s)
^
EqTri.java:9: '.class' expected
public EqTri(double x,String s)
^
EqTri.java:9: ';' expected
public EqTri(double x,String s)
^
EqTri.java:9: ';' expected
public EqTri(double x,String s)
^
EqTri.java:15: illegal start of expression
public setsideLength(double x)
^
EqTri.java:15: '.class' expected
public setsideLength(double x)
^
EqTri.java:15: ';' expected
public setsideLength(double x)
^
EqTri.java:20: illegal start of expression
public setIdentifier(String s)
^
EqTri.java:20: ')' expected
public setIdentifier(String s)
^
EqTri.java:20: illegal start of expression
public setIdentifier(String s)
^
EqTri.java:20: ';' expected
public setIdentifier(String s)
Thank you again.