我就不吃芹菜

导航

 
package com.model;

public class TestClass {
    
    private String name1;
    private String name2;
    private String name3;
    
    public String getName1() {
        return name1;
    }
    public TestClass setName1(String name1) {
        this.name1 = name1;
        return this;
    }
    public String getName2() {
        return name2;
    }
    public TestClass setName2(String name2) {
        this.name2 = name2;
        return this;
    }
    public String getName3() {
        return name3;
    }
    public TestClass setName3(String name3) {
        this.name3 = name3;
        return this;
    }
}

 

package com.model;

public class Main {

    public static void main(String[] args) {
        TestClass tc = new TestClass();
        tc.setName1("张三").setName2("李四").setName3("王二麻子");
        System.out.println(tc.getName1());
        System.out.println(tc.getName2());
        System.out.println(tc.getName3());
    }

}

 

posted on 2016-09-01 22:12  我就不吃芹菜  阅读(182)  评论(0编辑  收藏  举报