counter.java
来自「《J2EE编程技术》作者郝玉龙—源代码 《J2EE编程技术》作者郝玉龙—源代码」· Java 代码 · 共 33 行
JAVA
33 行
/*
* Created on 2004-6-20
*
* To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
package com.jsp;
/**
* @author haoyulong
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class Counter {
// 初始化JavaBean的成员变量
int count = 0;
// Class构造器
public Counter() {
}
// 属性count的Get方法
public int getCount() {
// 获取计数器的值,每一次请求都将计数器加1
count++;
return this.count;
}
// 属性Count的Set方法
public void setCount(int count) {
this.count = count;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?