class triangle
{
float s1,s2,s3,area;
triangle(float s1,float s2,float s3)
{
s1=s1;
s2=s2;
s3=s3;
}
float getarea()
{
float p=getgirth()/2;
float area=(float)Math.sqrt(p*(p-s1)*(p-s2)*(p-s3));
return area;
}
float getgirth()
{
return s1+s2+s3;
}
}
public class Ex3_10
{
public static void main (String args[])
{
float s1=Integer.parseInt(args[0]),s2=Integer.parseInt(args[1]),s3=Integer.parseInt(args[2]),girth,area;
triangle ff=new triangle(s1,s2,s3);
area=ff.getarea();
girth=ff.getgirth();
System.out.println(area+","+girth);
}
}
好像这个程序师没有错误了,但是还是报错了,
类 Ex3_10 是公共的,应在名为 Ex3_10.java 的文件中声明
public class Ex3_10
知道的大虾说个,帮个忙啊。