作者:chenhe86888 | 来源:互联网 | 2022-01-22 23:21
1.包:
代码如下:
package PaintBrush;
/**
*
* @author lucifer
*/
public class PaintBrush {
private String curcolor = "red";
public String getColor(){
return curcolor;
}
public void setColor(String color){
curcolor = color;
}
}
2.JSP代码:
代码如下:
<%--
Document : TestSetPro
Created on : 2009-10-3, 15:02:50
Author : lucifer
--%>
<%@page cOntentType="text/html" pageEncoding="UTF-8"%>
"http://www.w3.org/TR/html4/loose.dtd">
Original Color:
Changed Color:
3.输出:
Original Color: red
Changed Color: blue