<%@ page language=“java” contentType=“text/html; charset=UTF-8”
pageEncoding=“UTF-8”%>
<%!
public class circle
{
double ss(double a)
{
return Math.PI*a*a;
}
}
%>
<%
circle ss=new circle();
%>
<% double a1=0; if(request.getParameter("a")!=null) a1=Double.parseDouble(request.getParameter("a")); %> 半径为<%=a1%>的圆的面积为<%=ss.ss(a1) %>