publicclassTriangle{
doublex,y,a;
publicTriangle(doublex,doubley,doublea){
this.x=x;
this.y=y;
this.a=a;
}
publicvoidsetA(doublea){
this.a=a;
}
publicdoublegetArea(){
return0.5*x*y*Math.sin(Math.toRadians(a));
}
}publicclassTestTriangle{
publicstaticvoidmain(String[]args){
Triangletriangle=newTriangle(3.0,6.0,30.0);
System.out.println(triangle.getArea());
triangle.setA(90.0);
System.out.println(triangle.getArea());
}
}