把功能用类封装起来确实很方便,修改也容易。
class Hello{
private String hello="";
public Hello() {
hello="Hello World!";
}
public String getHello() {
return hello;
}
}
class Hello{
private String hello="";
public Hello() {
hello="Hello World!";
}
public String getHello() {
return hello;
}
}