Lader.java
packagetom.jiafei;
public class Lader
{ doubleabove,bottom,area;
publicLader()
{ above=1;
bottom=1;
area=(above+bottom)/2.0;
}
public double getAbove()
{ return above;
}
public void setAbove(double above)
{ this.above=above;
}
public double getBottom()
{ return bottom;
}
public void setBottom(double bottom)
{ this.bottom=bottom;
}
public double getArea()
{ area=(above+bottom)/2.0;
return area;
}
}
jsp帮助文档useBean.jsp
<%@ page contentType="text/html;Charset=GB2312" %>
<%@ page import="tom.jiafei.*"%>
<HTML>
<BODY bgcolor=cyan><Font size=5>
<jsp:useBean id="lader" class="tom.jiafei.Lader" scope="page" /> <% lader.setAbove(300);
lader.setBottom(2300);
%>
<P>梯形的上底是:<%=Above()%>
<P>梯形的下底是:<%=Bottom()%>
<P>梯形的面积是:<%=Area()%>
</BODY></HTML>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论