<html>
<head>
<title>this is java page</title>
</head>
<body>
<!–显示注释 注释内容 –>
<%!
public static final int x=10;
%>
<%!
public int add(int x,int y)
{
return x+y;
}
%>
<%!
class person
{
private String name;
private int age;
public person(String name,int age)
{
this.name=name;
this.age=age;
}
public String toString()
{
return “name=”+name+”,age=”+age;
}
}
%>
<%!
public int li=20;
%>
<%
person p=new person(“test”,10);
out.println(p);
out.println(li);
out.println(add(x,20));
%>
<%
int b=10;
out.println(b);
%>
</body>
</html>