public background(){ 这里少}号
public void setBackgroundColor(String backgroundColor){

解决方案 »

  1.   

    各位这么自信,有没有这样去试一下呀:
    javac background.java
    提示:
    illegal start of expression
    public void setBackgroundColor(String backgroundColor){
    ^
    an error
      

  2.   

    hehe ,真惭愧,我没有仔细看你的代码,你怎么方法套方法啊?
    这样可以了。但是不知道你要干吗?只是一个bean吗?
    通过:public class background{
    private String backgroundColor="";
    private String textColor="";
    private int size=1;
    public background(){}
    public void setBackgroundColor(String backgroundColor){
    this.backgroundColor=backgroundColor;
    }
    public String getBackgroundColor(){
    return this.backgroundColor;
    }
    public void setTextColor(String textColor){
    this.textColor=textColor;
    }
    public String getTextColor(){
    return this.textColor;
    }
    public void setSizse(int size){
    this.size=size;
    }
    public int getSize(){
    return this.size;
    }

    }