java cmd报错找不到符号
代码是这样的:
import java.util.Scanner;
public class Sanjiaoxing{
private int a;
private int b;
private int c;
public void Delta(int A,int B, int C){
this.a=A;
this.b=B;
this.c=C;
}
public double Area() {
double d=(a+b+c)/2;
return Math.sqrt(d*(d-a)*(d-b)*(d-c));
}
public static void main(String args[]) {
Scanner input=new Scanner(System.in);
int a,b,c;
System.out.print("输入三条边:");
a=input.nextInt();
b=input.nextInt();
c=input.nextInt();
if(a+b>c && a+c>b && b+c>a) {
Delta s[]=new Delta(a,b,c);
System.out.println("面积:"+s.Area());
}
else{
int min=a;
if(b<min)
min=b;
if(c<min)
min=c;
Delta s[]=new Delta(min,min,min);
System.out.println("面积:"+s.Area());
}
}
}
想了好久,为啥Delta成类了