<%@ page language= "java" import = "java.util.*" contentType= "text/html; charset=gb2312" %> |
<%! |
int num= 0 ; |
synchronized void add(){ |
num++; |
} |
%> |
<% add(); %> |
<html> |
<head> |
<title>unit4- 2 </title> |
</head> |
<body> |
<center> |
实现计数功能,你是第<%=num%>位访问的游客! |
</center> |
</body> |
</html> |