(技巧提示)如何在JSP里写内部类[inner,class]

类别:Java 点击:0 评论:0 推荐:
<html>
<body>
<%!
class Hello{
private String hello="";
public Hello() {
hello="Hello World!";
}
public String getHello() {
return hello;
}
}
%>

<%
Hello hello = new Hello();
%>
<h1>
<%= hello.getHello() %>
</h1>
</body>
</html>

本文地址:http://com.8s8s.com/it/it18361.htm