吸气剂和安装工不在android中工作

时间:2015-12-20 13:17:42

标签: java android getter-setter

package com.location.location;

/**
 * Created by user on 14-12-2015.
 */
public class UserDetailsTable {

    String firstName,lastName,userName,password;

    public UserDetailsTable(String firstName, String lastName, String userName,
                            String password) {
        super();
        this.firstName = firstName;
        this.lastName = lastName;
        this.userName = userName;
        this.password = password;
    }

    public UserDetailsTable() {
        super();
        this.firstName = null;
        this.lastName = null;
        this.userName = null;
        this.password = null;

    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() { return lastName; }

    public void setLastName(String lastName) { this.lastName = lastName; }

    public void setUserName(String userName) { this.userName = userName;  }
    public String getUserName() { return userName; }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

}

我不知道我哪里出错......我从四个参数中得到三个值...我得到的参数是名字,姓氏和密码, 对于用户名,setter方法setuserName表示"方法设置器从不使用" 我知道这是愚蠢的,但我没有看到任何出路......请帮助......

1 个答案:

答案 0 :(得分:1)

首先,构造函数不应该有super();因为班级没有扩展另一个。

接下来你的setter / getter区分大小写。请尝试调用setUserName